Do the AppOptions.get("printResolution") lookup once in web/app.js, when initializing PDFPrintServiceFactory-instances, rather than for every printed page

There's really no point in repeating these lookups over and over, since the value should be constant for the duration of one print invocation anyway.
This commit is contained in:
Jonas Jenwald 2020-08-05 13:24:32 +02:00
parent 63e33a5895
commit 97d796e372
3 changed files with 74 additions and 15 deletions

View file

@ -1609,10 +1609,13 @@ const PDFViewerApplication = {
const pagesOverview = this.pdfViewer.getPagesOverview();
const printContainer = this.appConfig.printContainer;
const printResolution = AppOptions.get("printResolution");
const printService = PDFPrintServiceFactory.instance.createPrintService(
this.pdfDocument,
pagesOverview,
printContainer,
printResolution,
this.l10n
);
this.printService = printService;