Skip to content

PDF20 Spec Annex K

Marc Jones edited this page Dec 30, 2025 · 1 revision

Annex K: XFA Forms

Part of: PDF20-Spec-Index

Navigation: PDF20-Spec-Annex-J | PDF20-Spec-Index | PDF20-Spec-Annex-L


Annex K (normative) XFA forms K.1

General

This annex is deprecated in PDF 2.0. Interactive forms (12.7, “Forms”), also called AcroForms, were introduced in PDF 1.2 and serve as a collection of fields for gathering or presenting variable information interactively from the user. The XML Forms Architecture (XFA) was introduced in PDF 1.5 to address the need where the number of fields needs to vary depending upon the quantity of entries, that can be accommodated through XFA's use of a form schema (which is called a "template" in the XFA specification). XFA forms were deprecated with PDF 2.0. If an interactive processor supports XFA forms, that processor shall clearly indicate to the user when they are interacting with an XFA form that they are interacting with an XFA form. The introduction of dynamically generated pages guided by schemas is a considerable departure from the fixed page model of PDF files designed to address use cases where dynamic forms are a strong requirement and therefore this architecture is documented separately from PDF (XFA reference). EXAMPLE

An invoice form may need to provide a variable number of invoice item fields ranging from 2 or 3 to hundreds or thousands. When the exact number of invoice items is determined, using the directives found in the XFA schema, a specific set of pages can be created to accommodate the required number of fields.

The implementation of such a schema driven page generation involves considerable effort beyond that for a simple PDF viewer and therefore a PDF processor may choose to not implement this feature. This annex describes how XFA is integrated into PDF, where the schema (template) description can be found within the PDF, and where the various types of XML data can be found. Whether or not the pages generated by the processing of an XFA schema are materialized as PDF pages is implementation dependent.

K.2

Access to the XFA template and other resources

The XFA entry in the interactive forms dictionary (see "Table 224 — Entries in the interactive form dictionary") specifies an XFA resource, which shall be an XML stream that contains the form information. The format of an XFA resource is described in the XML Data Package (XDP) Specification. The XFA entry shall be either a stream containing the entire XFA resource or an array specifying individual packets that together make up the XFA resource. The resource includes but is not limited to the following information: •

944

The form template (specified in the template packet), which describes the characteristics of the form, including its fields, calculations, validations, and formatting. The XML Template Specification describes the architecture of a form template. © ISO 2020 – All rights reserved

ISO 32000-2:2020(E)

•

The data (specified in the datasets packet), which represents the state of the form

•

The configuration information (specified in the config packet), which shall be used to properly process the form template and associated data. Configuration information shall be formatted as described in the XML Configuration Specification.

A packet is a pair of a string and stream. The string contains the name of the XML element and the stream contains the complete text of this XML element. Each packet represents a complete XML element, with the exception of the first and last packet, which specify begin and end tags for the xdp:xdp element (see Example 1 in this subclause). EXAMPLE 1

This example shows the XFA entry consisting of an array of packets.

1 0 obj <</XFA [(xdp:xdp) 10 0 R (template) 11 0 R (datasets) 12 0 R (config) 13 0 R (/xdp:xdp) 14 0 R]

endobj

%XFA entry in interactive form dictionary %XFA resource specified as individual packets

10 0 obj stream <xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/"> endstream 11 0 obj stream endstream 12 0 obj stream <xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"> … contents of datasets packet … </xfa:datasets> endstream 13 0 obj stream … contents of config node of XFA Data Package … endstream 14 0 obj stream </xdp:xdp> endstream

EXAMPLE 2

The following example shows the same entry specified as a stream.

1 0 obj <</XFA 10 0 R>> endobj

%XFA entry in interactive form dictionary

10 0 obj stream <xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/">

© ISO 2020 – All rights reserved

945

ISO 32000-2:2020

… contents of datasets packet … … contents of config node of XFA Data Package … endstream endobj

When an XFA entry is present in an interactive form dictionary, the XFA resource provides information about the form; in particular, all form-related events such as calculations and validations. The other entries in the interactive form dictionary shall be consistent with the information in the XFA resource. When creating or modifying a PDF file with an XFA resource, a PDF writer shall follow these rules: •

PDF interactive form field objects shall be present for each field specified in the XFA resource. The XFA field values shall be consistent with the corresponding V entries of the PDF field objects.

•

The XFA Scripting Object Model (XFA SOM) specifies a naming convention that shall be used to connect interactive form field names with field names in the XFA resource. Information about this model is available in the Adobe XML Architecture, XML Forms Architecture (XFA) Specification, version 3.3.

•

No A (see "Table 166 — Entries common to all annotation dictionaries") or AA entries (see "Table 190 — Additional entries specific to a screen annotation" and "Table 191 — Additional entries specific to a widget annotation") shall be present in the annotation dictionaries of fields that also have actions specified by the XFA resource.

946

© ISO 2020 – All rights reserved

ISO 32000-2:2020(E)


Navigation: PDF20-Spec-Annex-J | PDF20-Spec-Index | PDF20-Spec-Annex-L

Clone this wiki locally