Posted by: qwick | January 11, 2009

Filling PDF Forms in PHP

There are many ways to fill PDF files with data.  This article should help you decide which solution works best for you.  I will be adding many more options in the future.

FDF/XFDF

Using FDF/XFDF files is a clean and simple answer.  These small files provide the data values to a standard PDF form file.

How it Works

When you open the FDF file, the original PDF form is loaded with the values in the FDF file.  The original PDF file is downloaded from any web location.

Advantages

  • Very easy to implement
  • No third party libraries or applications required on the web server
  • Free
  • Filled out form files are small
  • Form data is stored separately from the PDF form making spelling mistakes easy to fix

Disadvantages

  • The original PDF must be web accessible
  • Some PDF programs may not support the FDF format
  • The PDF form must be created in a way that has named fields

Implementation

A great tutorial showing exactly how to produce FDF and XFDF files in native PHP code (no PECL extension or executable required)

http://koivi.com/fill-pdf-form-fields/

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Categories

Follow

Get every new post delivered to your Inbox.