Merge pull request #14066 from Snuffleupagus/XFAF-viewer-warning

Print a special warning message, in the viewer, for XFA Foreground documents
This commit is contained in:
Jonas Jenwald 2021-09-23 21:05:33 +02:00 committed by GitHub
commit f38b3ce523
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -3060,6 +3060,7 @@ class WorkerTransport {
const params = this._params;
return shadow(this, "loadingParams", {
disableAutoFetch: params.disableAutoFetch,
enableXfa: params.enableXfa,
});
}
}

View File

@ -1555,10 +1555,13 @@ const PDFViewerApplication = {
if (
info.IsXFAPresent &&
!info.IsAcroFormPresent &&
// Note: `isPureXfa === true` implies that `enableXfa = true` was set.
!pdfDocument.isPureXfa
) {
console.warn("Warning: XFA support is not enabled");
if (pdfDocument.loadingParams.enableXfa) {
console.warn("Warning: XFA Foreground documents are not supported");
} else {
console.warn("Warning: XFA support is not enabled");
}
this.fallback(UNSUPPORTED_FEATURES.forms);
} else if (
(info.IsAcroFormPresent || info.IsXFAPresent) &&