diff --git a/web/app.js b/web/app.js index dbd364fb2..e9389632d 100644 --- a/web/app.js +++ b/web/app.js @@ -699,7 +699,10 @@ const PDFViewerApplication = { }, get supportsPrinting() { - return PDFPrintServiceFactory.instance.supportsPrinting; + return ( + (typeof PDFJSDev === "undefined" || !PDFJSDev.test("GECKOVIEW")) && + PDFPrintServiceFactory.instance.supportsPrinting + ); }, get supportsFullscreen() { diff --git a/web/viewer-geckoview.css b/web/viewer-geckoview.css index 3009c167c..adc72efa5 100644 --- a/web/viewer-geckoview.css +++ b/web/viewer-geckoview.css @@ -246,61 +246,6 @@ dialog :link { margin: 0; } -#printContainer { - display: none; -} - -@media print { - body { - background: rgba(0, 0, 0, 0) none; - } - body[data-pdfjsprinting] #outerContainer { - display: none; - } - body[data-pdfjsprinting] #printContainer { - display: block; - } - #printContainer { - height: 100%; - } - /* wrapper around (scaled) print canvas elements */ - #printContainer > .printedPage { - page-break-after: always; - page-break-inside: avoid; - - /* The wrapper always cover the whole page. */ - height: 100%; - width: 100%; - - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - } - - #printContainer > .xfaPrintedPage .xfaPage { - position: absolute; - } - - #printContainer > .xfaPrintedPage { - page-break-after: always; - page-break-inside: avoid; - width: 100%; - height: 100%; - position: relative; - } - - #printContainer > .printedPage canvas, - #printContainer > .printedPage img { - /* The intrinsic canvas / image size will make sure that we fit the page. */ - max-width: 100%; - max-height: 100%; - - direction: ltr; - display: block; - } -} - .visibleLargeView, .visibleMediumView { display: none; diff --git a/web/viewer-geckoview.html b/web/viewer-geckoview.html index 312a626ba..01cb31bb7 100644 --- a/web/viewer-geckoview.html +++ b/web/viewer-geckoview.html @@ -86,7 +86,6 @@ See https://github.com/adobe-type-tools/cmap-resources -
diff --git a/web/viewer-geckoview.js b/web/viewer-geckoview.js index d14aaee0e..a6a064d5c 100644 --- a/web/viewer-geckoview.js +++ b/web/viewer-geckoview.js @@ -36,7 +36,6 @@ window.PDFViewerApplicationOptions = AppOptions; if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) { require("./firefoxcom.js"); - require("./firefox_print_service.js"); } function getViewerConfiguration() { @@ -52,7 +51,6 @@ function getViewerConfiguration() { submitButton: document.getElementById("passwordSubmit"), cancelButton: document.getElementById("passwordCancel"), }, - printContainer: document.getElementById("printContainer"), openFileInput: typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC") ? document.getElementById("fileInput") @@ -71,10 +69,7 @@ function webViewerLoad() { document.head.append(link); } - Promise.all([ - import("pdfjs-web/genericcom.js"), - import("pdfjs-web/pdf_print_service.js"), - ]).then(function ([genericCom, pdfPrintService]) { + import("pdfjs-web/genericcom.js").then(function (genericCom) { PDFViewerApplication.run(config); }); } else {