Skip to content

Commit b34ea06

Browse files
committed
Don't provide the enableXfa parameter to the BaseViewer constructor, and avoid the fallback bar with enableXfa = true set (PR 13069 follow-up)
Given that the `enableXfa` parameter must to be passed to the API/Worker, and thus included in the `getDocument` call, it's not necessary to include it when initializing the `PDFViewer`-instance used in the default viewer. (Also, in `AppOptions`, the parameter is clearly marked with `OptionKind.API`.) Furthermore, we probably don't want to display the fallback bar (in Firefox) for XFA documents when `enableXfa = true` is set.
1 parent c6b44d1 commit b34ea06

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

web/app.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,6 @@ const PDFViewerApplication = {
518518
useOnlyCssZoom: AppOptions.get("useOnlyCssZoom"),
519519
maxCanvasPixels: AppOptions.get("maxCanvasPixels"),
520520
enableScripting: AppOptions.get("enableScripting"),
521-
enableXfa: AppOptions.get("enableXfa"),
522521
});
523522
pdfRenderingQueue.setViewer(this.pdfViewer);
524523
pdfLinkService.setViewer(this.pdfViewer);
@@ -1561,7 +1560,11 @@ const PDFViewerApplication = {
15611560
this.setTitle(contentDispositionFilename);
15621561
}
15631562

1564-
if (info.IsXFAPresent && !info.IsAcroFormPresent) {
1563+
if (
1564+
info.IsXFAPresent &&
1565+
!info.IsAcroFormPresent &&
1566+
pdfDocument.isPureXfa // Implies that `enableXfa = true` was set.
1567+
) {
15651568
console.warn("Warning: XFA is not supported");
15661569
this._delayedFallback(UNSUPPORTED_FEATURES.forms);
15671570
} else if (

0 commit comments

Comments
 (0)