Using an HTML Front-End to Fill PDF Forms

By: Sid Steward

A complete discussion of this technique will be published in MacTech magazine.


This is an example of how you can fill PDF forms by means of an HTML form interface. The engine that performs the heavy lifting is pdftk version 1.11. The scripting language glue is PHP.

The following demo session is pretty bare bones because it is automatically generated from the form field data present in the PDF form. The web programmer must pick up where the automation leaves off to make the form user friendly.

The great advantage to this method of filling PDF forms is that it doesn't depend on fancy PDF viewer features. The resulting PDF works in any PDF viewer, such as Apple Preview or Xpdf. And, the data is permanently merged with the form, allowing the user to keep it for her files. Adobe Reader does not permit permanent merging of forms and data.

Enter the Session

Download the Code


November 3, 2004 ~ Copyright © 2004, Sid Steward