mozilla/pdf.js

This commit is contained in:
2026-07-15 22:31:10 -05:00
parent 5c69c40453
commit ba16f5fe06
4 changed files with 172 additions and 5 deletions

View File

@@ -71,6 +71,13 @@ class PdfViewer {
url,
rangeChunkSize: 65536,
disableAutoFetch: false,
// PDF.js >= 5 decodes CCITT-G4/JBIG2 (B/W scans), JPEG2000 and ICC
// color via WASM modules fetched from wasmUrl. Without these URLs
// the decoders fail silently (ignoreErrors default) and scanned
// pages render as blank white canvases of the correct size.
wasmUrl: "/pdfjs/wasm/",
standardFontDataUrl: "/pdfjs/standard_fonts/",
iccUrl: "/pdfjs/iccs/",
});
this.loadingTask = task;
@@ -259,4 +266,4 @@ function errorMsg(err) {
return err instanceof Error ? err.message : String(err);
}
globalThis.PdfViewer = PdfViewer;
globalThis.PdfViewer = PdfViewer;