Chapter 7. AcroForms
This chapter will go into detail on a special type of annotation: the widget annotation that is the building block for PDF forms.
PDF 1.2 introduced the concept of an interactive form (a collection of fields that can be used to gather information interactively from a user) to the PDF format. There will be at most one single, global form in the PDF; it can contain any number of fields, which can appear on any combination of pages.
Note
Interactive forms should not be confused with form XObjects (discussed in Vector Images). Despite the similarity of their names, the two are different, unrelated types of objects.
The Interactive Form Dictionary
The document’s interactive form is described using an interactive form dictionary, which is the value of the AcroForm
key found in the document catalog dictionary.
Note
Because that is the name of the key, the interactive form dictionary is frequently referred to as the AcroForm dictionary and the type of form as an AcroForm.
This dictionary has only one required key, Fields
, which specifies an array of field dictionaries that represent the fields in the form. However, there are a few common optional fields that you may need to specify for some of your forms:
-
DR
- When creating the appearance streams for your fields, you may wish to refer to some resources shared by one or more fields. The resource dictionary specified by this key serves to provide that information, much as the page resource dictionary does for page content. If ...
Get Developing with PDF now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.