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
Editing a PDF document
Moderator: General Moderators
Re: Editing a PDF document
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!
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!
Re: Editing a PDF document
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.
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
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
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