mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
Re-factor PDFPrintServiceFactory
to use import maps
This is very old code, which can (ever so slightly) be simplified now that import maps are available.
This commit is contained in:
parent
60fd9d583d
commit
898172e9d2
6 changed files with 48 additions and 35 deletions
17
web/app.js
17
web/app.js
|
@ -70,6 +70,7 @@ import { PDFHistory } from "./pdf_history.js";
|
|||
import { PDFLayerViewer } from "web-pdf_layer_viewer";
|
||||
import { PDFOutlineViewer } from "web-pdf_outline_viewer";
|
||||
import { PDFPresentationMode } from "web-pdf_presentation_mode";
|
||||
import { PDFPrintServiceFactory } from "web-print_service";
|
||||
import { PDFRenderingQueue } from "./pdf_rendering_queue.js";
|
||||
import { PDFScriptingManager } from "./pdf_scripting_manager.js";
|
||||
import { PDFSidebar } from "web-pdf_sidebar";
|
||||
|
@ -731,7 +732,7 @@ const PDFViewerApplication = {
|
|||
},
|
||||
|
||||
get supportsPrinting() {
|
||||
return PDFPrintServiceFactory.instance.supportsPrinting;
|
||||
return PDFPrintServiceFactory.supportsPrinting;
|
||||
},
|
||||
|
||||
get supportsFullscreen() {
|
||||
|
@ -1786,7 +1787,7 @@ const PDFViewerApplication = {
|
|||
const optionalContentConfigPromise =
|
||||
this.pdfViewer.optionalContentConfigPromise;
|
||||
|
||||
const printService = PDFPrintServiceFactory.instance.createPrintService(
|
||||
const printService = PDFPrintServiceFactory.createPrintService(
|
||||
this.pdfDocument,
|
||||
pagesOverview,
|
||||
printContainer,
|
||||
|
@ -3234,14 +3235,4 @@ function webViewerReportTelemetry({ details }) {
|
|||
PDFViewerApplication.externalServices.reportTelemetry(details);
|
||||
}
|
||||
|
||||
/* Abstract factory for the print service. */
|
||||
const PDFPrintServiceFactory = {
|
||||
instance: {
|
||||
supportsPrinting: false,
|
||||
createPrintService() {
|
||||
throw new Error("Not implemented: createPrintService");
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export { PDFPrintServiceFactory, PDFViewerApplication };
|
||||
export { PDFViewerApplication };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue