Editing a PDF document

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Apas
Forum Newbie
Posts: 7
Joined: Thu Apr 03, 2008 1:08 am
Location: Bochum, Germany
Contact:

Editing a PDF document

Post 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
User avatar
highjo
Forum Contributor
Posts: 118
Joined: Tue Oct 24, 2006 1:07 pm

Re: Editing a PDF document

Post 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:
User avatar
rlg0613
Forum Newbie
Posts: 12
Joined: Sat Aug 25, 2007 10:15 am

Re: Editing a PDF document

Post 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.
User avatar
Apas
Forum Newbie
Posts: 7
Joined: Thu Apr 03, 2008 1:08 am
Location: Bochum, Germany
Contact:

Re: Editing a PDF document

Post 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
Post Reply