Page 1 of 1

Editing a PDF document

Posted: Thu Feb 26, 2009 7:58 am
by Apas
Hi,

I want to open an existing PDF document. Then I want to replace some placeholders like <<name>> with data from a database and write the new pdf file to the filesystem.

Is there an opportunity to do this with PHP?

Greetings
apas

Re: Editing a PDF document

Posted: Thu Feb 26, 2009 10:20 am
by highjo
Pdf are disigned to be final format? why don't you create your own with whatever you have as design in php with the good library TCPDF .Then instead of saying edit the file you would rather edit your template or how the data is displayed or add new stuff.That all i know if you want to edit it from php.
But if you don't want to do it programmatically or you've changed your mind you can use acrobat pro or adobe illustrator to edit your files.Hope this helps! :wink:

Re: Editing a PDF document

Posted: Tue Mar 03, 2009 12:48 pm
by rlg0613
Apas,

Do you know about fpdf http://www.fpdf.org/ and fpdi http://www.setasign.de/products/pdf-php-solutions/fpdi/ ?

One (fpdf) lets you create a pdf document and the other (fpdi) lets you start with an existing pdf as a template. This doesn't solve the problem of finding the placeholders though. I'm struggling with the same problem. Some posts I've seen recommend using an RTF file as the template and than constructing the pdf by parsing the RTF and basically doing a string replace in the RTF (placeholders for database values). Then, using Ted (if you're on a Unix box) to do an RTF to pdf transformation. Seems like a long way around plus you have to create an RTF reader script.

I'd be happy to share ideas with you on this as I need to solve it too.

Re: Editing a PDF document

Posted: Wed Mar 04, 2009 2:25 am
by Apas
I have also gone the same way.
But the solution with fpd* would, as you say, not solve the problem with the placeholders.

We are also thinking about the solution with RTF-Files, but the problem is we are running "Zendcore for i5/OS" and I wasn't able to get a version of TED compiled in the stripped-down unix named PASE that is running on the i5....

Now I am searching for a binary of TED for the i5 or another solution to convert the RTFs to PDF.

I would be happy to hear from you if you find something.

If I find something myself I will post it.

Greetings
Apas