mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +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
|
@ -13,9 +13,9 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AnnotationMode, PixelsPerInch } from "pdfjs-lib";
|
||||
import { PDFPrintServiceFactory, PDFViewerApplication } from "./app.js";
|
||||
import { AnnotationMode, PixelsPerInch, shadow } from "pdfjs-lib";
|
||||
import { getXfaHtmlForPrinting } from "./print_utils.js";
|
||||
import { PDFViewerApplication } from "./app.js";
|
||||
|
||||
let activeService = null;
|
||||
let dialog = null;
|
||||
|
@ -355,10 +355,15 @@ function ensureOverlay() {
|
|||
return overlayPromise;
|
||||
}
|
||||
|
||||
PDFPrintServiceFactory.instance = {
|
||||
supportsPrinting: true,
|
||||
/**
|
||||
* @implements {IPDFPrintServiceFactory}
|
||||
*/
|
||||
class PDFPrintServiceFactory {
|
||||
static get supportsPrinting() {
|
||||
return shadow(this, "supportsPrinting", true);
|
||||
}
|
||||
|
||||
createPrintService(
|
||||
static createPrintService(
|
||||
pdfDocument,
|
||||
pagesOverview,
|
||||
printContainer,
|
||||
|
@ -378,7 +383,7 @@ PDFPrintServiceFactory.instance = {
|
|||
printAnnotationStoragePromise
|
||||
);
|
||||
return activeService;
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export { PDFPrintService };
|
||||
export { PDFPrintServiceFactory };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue