-
-
Save escapewindow/2e13c19e1ba47e25c09570e234c7f509 to your computer and use it in GitHub Desktop.
broken xfa diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/web/app.js b/web/app.js | |
index c2cbe1119..929cb9865 100644 | |
--- a/web/app.js | |
+++ b/web/app.js | |
@@ -1418,14 +1418,18 @@ const PDFViewerApplication = { | |
this.setTitle(contentDispositionFilename); | |
} | |
- if (info.IsXFAPresent) { | |
- console.warn("Warning: XFA is not supported"); | |
- } else if ( | |
- info.IsAcroFormPresent && | |
- !this.pdfViewer.renderInteractiveForms | |
- ) { | |
- console.warn("Warning: AcroForm support is not enabled"); | |
- this._delayedFallback(UNSUPPORTED_FEATURES.forms); | |
+ if (info.IsAcroFormPresent) { | |
+ const fields = pdfDocument.acroForm.get("fields"); | |
+ if ( | |
+ info.IsXFAPresent && | |
+ (!Array.isArray(fields) || fields.length === 0) | |
+ ) { | |
+ console.warn("Warning: XFA is not supported"); | |
+ this._delayedFallback(UNSUPPORTED_FEATURES.forms); | |
+ } else if (!this.pdfViewer.renderInteractiveForms) { | |
+ console.warn("Warning: AcroForm support is not enabled"); | |
+ this._delayedFallback(UNSUPPORTED_FEATURES.forms); | |
+ } | |
} | |
// Telemetry labels must be C++ variable friendly. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment