Question

Out of tons of questions and answers here about manipulating PDF's with PHP, but none of them seem to fit my requirement.

Programmatically, I want to be able to update the content of editable fields. Preferably with PHP. If it matters, the PDF files will be initially hand crafted (as sort of 'template' files that will be copied and filled in over and over again). The list of PDF_* functions on php.net doesn't give me anything that looks (directly) promising.

Is this possible with PHP? How?

Was it helpful?

Solution

The best way that maintains the look and feel of the original PDF is to use the PDFLib block plugin for Acrobat. PDFLib is the library behind all of the PHP PDF functions. More information on the block plugin can be found on the PDFLib website, there is a link on the main page called "The PDFlib Block Plugin".

The process to use is to create all of the "editable fields" known as blocks with the plugin in Acrobat. Once that is done, the template can be programmatically imported and the fields can be filled in. There are also features to match the font, size, style, etc. of the font on the page programmatically so that it appears correctly in the document. Here are pages in the cookbook on how to do various things with Block Handling and PPS: http://www.pdflib.com/pdflib-cookbook/block-handling-and-pps/

OTHER TIPS

TCPDF is the best PDF library.

However follow this: PHP PDF template library with PDF output?

:)

http://framework.zend.com/manual/en/zend.pdf.html

and more specifically here (unless I misunderstood you)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top