diff --git a/src/core/catalog.js b/src/core/catalog.js index f5e75a5ce..37cc32b28 100644 --- a/src/core/catalog.js +++ b/src/core/catalog.js @@ -86,6 +86,18 @@ class Catalog { return shadow(this, "version", version.name); } + /** + * @type {boolean} `true` for pure XFA documents, + * `false` for XFA Foreground documents. + */ + get needsRendering() { + const needsRendering = this._catDict.get("NeedsRendering"); + if (!isBool(needsRendering)) { + return shadow(this, "needsRendering", false); + } + return shadow(this, "needsRendering", needsRendering); + } + get collection() { let collection = null; try { diff --git a/src/core/document.js b/src/core/document.js index f8455f5e4..19f87d55d 100644 --- a/src/core/document.js +++ b/src/core/document.js @@ -882,6 +882,7 @@ class PDFDocument { get xfaFactory() { if ( this.pdfManager.enableXfa && + this.catalog.needsRendering && this.formInfo.hasXfa && !this.formInfo.hasAcroForm ) {