-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Open
Description
Currently for pdfjs to work you need this
import DOMMatrix from "npm:@thednp/dommatrix@2.0.12";
globalThis.DOMMatrix = DOMMatrix;
globalThis.process = undefined;
Object.defineProperty(navigator, "platform", {
value: "Linux",
});
const pdfjsLib = await import("npm:pdfjs-dist@5.4.149");
pdfjsLib.GlobalWorkerOptions.workerSrc = import.meta.resolve("npm:pdfjs-dist@5.4.149/build/pdf.worker.mjs");
Depends on:
- DOMMatrix feat(unstable): Geometry Interfaces Module Level 1 #27527
- navigator.platform Add
navigator.platform
#24117
What other improvements:
- currently you need to hide process global, I guess this can be improved upstream by detecting deno correctly
- would be great if deno detected the worker automatically
- it shows a warning about using fake worker, maybe there is a way to make it work with normal web workers since deno does support it
Note: The node legacy branch obviously works but it requires ffi (for npm canvas) while this one require no permission
Hajime-san and petamoriken
Metadata
Metadata
Assignees
Labels
No labels