RESTful web service for filling field values in a PDF template and then 'flattening' the PDF so the fields can no longer be edited.
Java PHP
Failed to load latest commit information.


FormFillFlatten is a RESTful web service which allows users to upload a
PDF template containing form elements, together with the values which
should used to fill those placeholders. FFF populates the form fields
and returns a 'flattened' PDF, which allows no further editing.

This software uses iText, which is licensed under the AGPL, and as such
FormFillFlatten is also AGPL-licensed. A copy of the AGPL can be found
in the file LICENCE in the root directory of this project.


* Java 1.6.0 or later (tested with OpenJDK 1.6.0_20)
* iText 5.0.6 or later (tested with 5.0.6)
* JSON-java
* PHP 5.2.0 or later (tested with 5.3.2)
* Web server which supports PHP (Apache 2.2.x recommended)

You *may* be able to get this working on Windows or Mac OS X, but you
will have a much smoother ride using a Debian/Ubuntu server running
Apache and mod_php.


In order to provide a mapping of field names to values, you must first
find out what the field names are for the PDF. The easiest way to do this
is via the pdftk command, which is available for the majority of Linux

The following command will show you the type and name of each form field
in a PDF:

pdftk input.pdf dump_data_fields

Example output might be:

FieldType: Text
FieldName: Text29
FieldFlags: 0
FieldValue: Default value for field
FieldJustification: Left

All you need to care about is the FieldName value, as this is the unique
name for the field. It may have a sensible name or an auto-generated one
such as Text29.