Merge pull request #13125 from Snuffleupagus/BaseViewer-enableXfa

Don't provide the `enableXfa` parameter to the `BaseViewer` constructor, and avoid the fallback bar with `enableXfa = true` set (PR 13069 follow-up)
This commit is contained in:
Tim van der Meij 2021-03-21 13:50:30 +01:00 committed by GitHub
commit d426ffdad9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -518,7 +518,6 @@ const PDFViewerApplication = {
useOnlyCssZoom: AppOptions.get("useOnlyCssZoom"),
maxCanvasPixels: AppOptions.get("maxCanvasPixels"),
enableScripting: AppOptions.get("enableScripting"),
enableXfa: AppOptions.get("enableXfa"),
});
pdfRenderingQueue.setViewer(this.pdfViewer);
pdfLinkService.setViewer(this.pdfViewer);
@ -1561,7 +1560,12 @@ const PDFViewerApplication = {
this.setTitle(contentDispositionFilename);
}
if (info.IsXFAPresent && !info.IsAcroFormPresent) {
if (
info.IsXFAPresent &&
!info.IsAcroFormPresent &&
// Note: `isPureXfa === true` implies that `enableXfa = true` was set.
!pdfDocument.isPureXfa
) {
console.warn("Warning: XFA is not supported");
this._delayedFallback(UNSUPPORTED_FEATURES.forms);
} else if (