Jump to content

ODT to PDF, some search and replacing needed. Is this possible with PHP?


Recommended Posts

Hi.

 

I am not asking for the solution provided to me on a silver plate. I am asking for some pointers of how to solve this.

 

I have a series of ODT files.

 

I need to write a PHP script that will do the equivalent of the following (described manually):

 

[*]Read some parameters from the HTML form.

[*]Open the document up.

[*]Unconditionally replace some unique markers with data from the form.

[*]Generate a PDF file.

[*]Output the result to the browser.

 

Can that be done with PHP? How?

 

This solution may suite you jodconverter

 

But if you want PHP then you could use Open Office COM support, I played with this for about an hour (during my lunch break) and it/I failed, I will probably need to revisit this at some stage. however your need Open Office installed on the Server,

 

If you want a pure PHP ODT to PDF then you could but its it may take a while to write the parse.

Thnks MasTechie.

 

jodconverter is something like what I look for, but not quite.

 

It is ismply  file converter. I could just do the convertion by hand and set it up if that tol would do the job for me.

 

I need omething that would enable the find and replace funtionality.

 

Like the DOM function. I will play with it for while.

 

I can arrange for OpenOffice to be installed into headless mode for me in the server. I have no problem with that.

 

As for manually writting the parser, I would rather avoid that.

 

Thanks.

 

As your installing OO, (which i think is the best solution but not always possible) then to save some time, you may want to create a macro to do the editing and PDFing, and then just have PHP call those macros, i'm just saying this as it may help, even if you only use the macro to create the PDF (as i think theirs on on their site)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.