1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00
Jonas Jenwald 2023-06-04 09:58:25 +02:00
parent bb5d38acc1
commit 5fad931a3f
3 changed files with 23 additions and 18 deletions

View file

@ -69,24 +69,22 @@ const DEFAULT_RANGE_CHUNK_SIZE = 65536; // 2^16 = 65536
const RENDERING_CANCELLED_TIMEOUT = 100; // ms
const DELAYED_CLEANUP_TIMEOUT = 5000; // ms
let DefaultCanvasFactory = DOMCanvasFactory;
let DefaultCMapReaderFactory = DOMCMapReaderFactory;
let DefaultFilterFactory = DOMFilterFactory;
let DefaultStandardFontDataFactory = DOMStandardFontDataFactory;
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("GENERIC") && isNodeJS) {
const {
NodeCanvasFactory,
NodeCMapReaderFactory,
NodeFilterFactory,
NodeStandardFontDataFactory,
} = require("./node_utils.js");
DefaultCanvasFactory = NodeCanvasFactory;
DefaultCMapReaderFactory = NodeCMapReaderFactory;
DefaultFilterFactory = NodeFilterFactory;
DefaultStandardFontDataFactory = NodeStandardFontDataFactory;
}
const DefaultCanvasFactory =
typeof PDFJSDev !== "undefined" && PDFJSDev.test("GENERIC") && isNodeJS
? require("./node_utils.js").NodeCanvasFactory
: DOMCanvasFactory;
const DefaultCMapReaderFactory =
typeof PDFJSDev !== "undefined" && PDFJSDev.test("GENERIC") && isNodeJS
? require("./node_utils.js").NodeCMapReaderFactory
: DOMCMapReaderFactory;
const DefaultFilterFactory =
typeof PDFJSDev !== "undefined" && PDFJSDev.test("GENERIC") && isNodeJS
? require("./node_utils.js").NodeFilterFactory
: DOMFilterFactory;
const DefaultStandardFontDataFactory =
typeof PDFJSDev !== "undefined" && PDFJSDev.test("GENERIC") && isNodeJS
? require("./node_utils.js").NodeStandardFontDataFactory
: DOMStandardFontDataFactory;
let createPDFNetworkStream;
if (typeof PDFJSDev === "undefined") {

View file

@ -28,6 +28,7 @@ import {
import { isNodeJS } from "../shared/is_node.js";
/** @type {any} */
// eslint-disable-next-line import/no-mutable-exports
let SVGGraphics = class {
constructor() {
unreachable("Not implemented: SVGGraphics");