Skip to content

Commit 56e7bb6

Browse files
authored
Merge pull request #13660 from calixteman/no_xfaf
XFA - Disable xfa rendering for XFAF pdfs
2 parents bf5a45c + 04573d2 commit 56e7bb6

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/core/catalog.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,18 @@ class Catalog {
8686
return shadow(this, "version", version.name);
8787
}
8888

89+
/**
90+
* @type {boolean} `true` for pure XFA documents,
91+
* `false` for XFA Foreground documents.
92+
*/
93+
get needsRendering() {
94+
const needsRendering = this._catDict.get("NeedsRendering");
95+
if (!isBool(needsRendering)) {
96+
return shadow(this, "needsRendering", false);
97+
}
98+
return shadow(this, "needsRendering", needsRendering);
99+
}
100+
89101
get collection() {
90102
let collection = null;
91103
try {

src/core/document.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -882,6 +882,7 @@ class PDFDocument {
882882
get xfaFactory() {
883883
if (
884884
this.pdfManager.enableXfa &&
885+
this.catalog.needsRendering &&
885886
this.formInfo.hasXfa &&
886887
!this.formInfo.hasAcroForm
887888
) {

0 commit comments

Comments
 (0)