-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Description
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 theNeedRendering
entry in the Catalog dictionary. Whentrue
, 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)