mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Convert FirefoxPrintService
and PDFPrintService
into standard classes
Note that both of the affected files are old enough to predate the general availability of `class`.
This commit is contained in:
parent
ebf493f726
commit
aeb8e36cdb
2 changed files with 52 additions and 52 deletions
|
@ -114,25 +114,25 @@ function composePage(
|
|||
};
|
||||
}
|
||||
|
||||
function FirefoxPrintService(
|
||||
pdfDocument,
|
||||
pagesOverview,
|
||||
printContainer,
|
||||
printResolution,
|
||||
optionalContentConfigPromise = null,
|
||||
printAnnotationStoragePromise = null
|
||||
) {
|
||||
this.pdfDocument = pdfDocument;
|
||||
this.pagesOverview = pagesOverview;
|
||||
this.printContainer = printContainer;
|
||||
this._printResolution = printResolution || 150;
|
||||
this._optionalContentConfigPromise =
|
||||
optionalContentConfigPromise || pdfDocument.getOptionalContentConfig();
|
||||
this._printAnnotationStoragePromise =
|
||||
printAnnotationStoragePromise || Promise.resolve();
|
||||
}
|
||||
class FirefoxPrintService {
|
||||
constructor(
|
||||
pdfDocument,
|
||||
pagesOverview,
|
||||
printContainer,
|
||||
printResolution,
|
||||
optionalContentConfigPromise = null,
|
||||
printAnnotationStoragePromise = null
|
||||
) {
|
||||
this.pdfDocument = pdfDocument;
|
||||
this.pagesOverview = pagesOverview;
|
||||
this.printContainer = printContainer;
|
||||
this._printResolution = printResolution || 150;
|
||||
this._optionalContentConfigPromise =
|
||||
optionalContentConfigPromise || pdfDocument.getOptionalContentConfig();
|
||||
this._printAnnotationStoragePromise =
|
||||
printAnnotationStoragePromise || Promise.resolve();
|
||||
}
|
||||
|
||||
FirefoxPrintService.prototype = {
|
||||
layout() {
|
||||
const {
|
||||
pdfDocument,
|
||||
|
@ -179,7 +179,7 @@ FirefoxPrintService.prototype = {
|
|||
_printAnnotationStoragePromise
|
||||
);
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
destroy() {
|
||||
this.printContainer.textContent = "";
|
||||
|
@ -191,8 +191,8 @@ FirefoxPrintService.prototype = {
|
|||
this.pageStyleSheet.remove();
|
||||
this.pageStyleSheet = null;
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
PDFPrintServiceFactory.instance = {
|
||||
get supportsPrinting() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue