Skip to content

Proposal: Add XFA Support to jsPDF #3886

@JDziurlaj

Description

@JDziurlaj

This proposal requests the addition of XML Forms Architecture (XFA) support to jsPDF.

XFA is an XML-based forms language carried within the PDF’s AcroForms dictionary, beginning with PDF 1.5. XFA documents are widely used in government, banking, legal, and other regulated domains that require advanced forms processing. Support for XFA has become more relevant as client-side rendering tools evolve; for example, pdf.js now implements XFA, which makes browser-based XFA workflows feasible. Aligning jsPDF with this capability would open new use cases where XFA forms are generated, embedded, or manipulated directly in JavaScript applications.


Proposed Approach

Extend the existing AcroForms module with a new function:

addXFA(XFAPayload, needsRendering)  { jsPDF }
  • XFAPayload
    May be either:

    • A stream containing the complete XML Data Package, or
    • An array of text string/stream pairs corresponding to the discrete packets comprising the XML Data Package (see PDF 1.7, §8.6, p. 673).
  • needsRendering
    Boolean flag that sets the NeedRendering entry in the Catalog dictionary. When true, this usually indicates a dynamic XFA form requiring client rendering logic. (see PDF 1.7, §3.6, p. 142).

No further architectural changes are necessary. The AcroForms mechanism remains fully supported within an XFA-enabled PDF. The AcroForms content in such files continues to act as a “fallback” for viewers that lack XFA processing capability.

See also PDF 1.7, §8.6.7 (pp. 722-724)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions