mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Change PDFPrintServiceFactory.createPrintService
to take a parameter object
By "modernizing" the method to use a parameter object instead, we avoid having to pass along the needed parameters individually.
This commit is contained in:
parent
14874e50b7
commit
a204f434f3
3 changed files with 19 additions and 55 deletions
25
web/app.js
25
web/app.js
|
@ -1781,26 +1781,19 @@ const PDFViewerApplication = {
|
|||
return;
|
||||
}
|
||||
|
||||
const pagesOverview = this.pdfViewer.getPagesOverview();
|
||||
const printContainer = this.appConfig.printContainer;
|
||||
const printResolution = AppOptions.get("printResolution");
|
||||
const optionalContentConfigPromise =
|
||||
this.pdfViewer.optionalContentConfigPromise;
|
||||
|
||||
const printService = PDFPrintServiceFactory.createPrintService(
|
||||
this.pdfDocument,
|
||||
pagesOverview,
|
||||
printContainer,
|
||||
printResolution,
|
||||
optionalContentConfigPromise,
|
||||
this._printAnnotationStoragePromise
|
||||
);
|
||||
this.printService = printService;
|
||||
this.printService = PDFPrintServiceFactory.createPrintService({
|
||||
pdfDocument: this.pdfDocument,
|
||||
pagesOverview: this.pdfViewer.getPagesOverview(),
|
||||
printContainer: this.appConfig.printContainer,
|
||||
printResolution: AppOptions.get("printResolution"),
|
||||
optionalContentConfigPromise: this.pdfViewer.optionalContentConfigPromise,
|
||||
printAnnotationStoragePromise: this._printAnnotationStoragePromise,
|
||||
});
|
||||
this.forceRendering();
|
||||
// Disable the editor-indicator during printing (fixes bug 1790552).
|
||||
this.setTitle();
|
||||
|
||||
printService.layout();
|
||||
this.printService.layout();
|
||||
|
||||
if (this._hasAnnotationEditors) {
|
||||
this.externalServices.reportTelemetry({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue