This repository has been archived by the owner on Jun 12, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
46 lines (35 loc) · 1.5 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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.
REQUIREMENTS
* 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.
EXTRACTING DATA FIELDS
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
distributions.
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.