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:
Jonas Jenwald 2024-02-13 21:28:02 +01:00
parent 14874e50b7
commit a204f434f3
3 changed files with 19 additions and 55 deletions

View file

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