So how do you find FDF forms inside a PDF file? Well, you will find most of the FDF forms data linked to the name ‘AcroForm’ inside a PDF file, this will then have a ‘Fields’ tag which will then list lots of PDF references which are all FDF forms. Some files will only have one or two, others contain hundreds.
So now we have the actual form and can look at the data defined within it, there will be lots of different tag names (letters) and there will be ones that you have never seen before, that you have to figure out what they are for. We have had many instances of this, some turn out to be ignorable, but some are really useful for distinguishing different fields apart so that they can be treated differently, I digress.
First we need to know what type of field we are dealing with to know what else to look for, the key tag name in this case is ‘FT’ this will tell you what type of field it is:-
Tx = is a text field.
Ch = is a choice field.
Btn = is a Button field.
Sig = is a Signature field.
There are other values, that all come under the term Annotation, which will be expanded upon at a later date.
Now we know the type of field, but there are multiple fields within most types. To find out which exact field you have you also need the value for tag name ‘Ff’, this is a byte sequence where each byte represents a different flag.
These are :-
Are you still following me, if so great, your have a knack for this. If not this might help:
Tx = Text (defaults to a single line text field, the flags are options)
byte 13 = multiline
byte 14 = password
Ch = choice
byte 18 = combo
no flag = list field
Btn = button
byte 16 = radio
byte 17 = push button
neither flag = check box button
In my next article I will give you an introduction to the XFA format. Stay tuned…
This post is part of our “Understanding the PDF File Format” series. In each article, we aim to take a specific PDF feature and explain it in simple terms. If you wish to learn more about PDF, we have 13 years worth of PDF knowledge and tips, so click here to visit our series index!
IDRsolutions develop a Java PDF library, a PDF forms to HTML5 converter, a PDF to HTML5 or SVG converter and a Java Image Library that doubles as an ImageIO replacement. On the blog our team post about anything interesting they learn about.