[GV] Remove print stuff because window.print isn't implemented (bug 1808668)

This commit is contained in:
Calixte Denizet 2023-01-05 11:28:04 +01:00
parent 7da591048c
commit 409c8b344f
4 changed files with 5 additions and 63 deletions

View File

@ -699,7 +699,10 @@ const PDFViewerApplication = {
},
get supportsPrinting() {
return PDFPrintServiceFactory.instance.supportsPrinting;
return (
(typeof PDFJSDev === "undefined" || !PDFJSDev.test("GECKOVIEW")) &&
PDFPrintServiceFactory.instance.supportsPrinting
);
},
get supportsFullscreen() {

View File

@ -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;

View File

@ -86,7 +86,6 @@ See https://github.com/adobe-type-tools/cmap-resources
</div> <!-- dialogContainer -->
</div> <!-- outerContainer -->
<div id="printContainer"></div>
<!--#if !MOZCENTRAL-->
<input type="file" id="fileInput" class="hidden">

View File

@ -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 {