Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modify PDF Forms from a PHP site

We currently use PDForm to grab a blank pdf file (no values, just form fields and text) and list the form fields. We then query our database for the values which match those field names and create a pdf file with the newly populated data which the user can download from our site. The thing is PDForm is about $5,000 per machine and we are migrating servers. We want an alternative which is actively supported and recommended by the community.

I know Zend is working on a PDF manipulation extension, but we need something quick. I have done testing with PDFtk but the last update for that project was in 2006 and it now seems dead. It would be fine as it is open source, however it seems to be causing errors with certain files that seem to be generated with PDFPenPro (our pdf form creator).

Another solution I thought up was why not just use iText and write a java wrapper which accepts command line input, so that PHP can call it with passthru() or exec(). There are other applications that will work should we completely rewrite our code but we do not want to do that.

What we need.

  1. The ability for PHP to receive the PDF form field names.
  2. PHP to then either create and FDF file (then merge it with the PDF) or send a string to a command line application which will populate the fields with values from our database.
  3. The user can then download the newly created PDF file with the populated form fields.

Am I moving in the write direction by creating a java command line application that will use iText to parse and create the PDF files specified by PHP or does anyone know of any cost effective alternatives?

like image 887
Bot Avatar asked Jun 28 '26 10:06

Bot


1 Answers

TCPDF seems to have the most robust feature set that I have seen so far.

like image 160
d2burke Avatar answered Jun 30 '26 22:06

d2burke