Bundle the necessary files and set the correct cMapUrl, iccUrl, and standardFontDataUrl when building gulp internal-viewer

Without these changes none of the relevant functionality would work in the *built* internal-viewer.
This commit is contained in:
Jonas Jenwald 2026-03-13 18:14:10 +01:00
parent a7083d08ff
commit 75739a173b
2 changed files with 11 additions and 3 deletions

View File

@ -2403,6 +2403,9 @@ function buildInternalViewer(defines, dir) {
]) ])
) )
.pipe(gulp.dest(dir + "web")), .pipe(gulp.dest(dir + "web")),
createCMapBundle().pipe(gulp.dest(dir + "web/cmaps")),
createICCBundle().pipe(gulp.dest(dir + "web/iccs")),
createStandardFontBundle().pipe(gulp.dest(dir + "web/standard_fonts")),
createWasmBundle().pipe(gulp.dest(dir + "web/wasm")), createWasmBundle().pipe(gulp.dest(dir + "web/wasm")),
]); ]);
} }

View File

@ -851,10 +851,15 @@ async function openDocument(source, name) {
const loadingTask = getDocument({ const loadingTask = getDocument({
...source, ...source,
cMapUrl: "../external/bcmaps/", cMapUrl:
typeof PDFJSDev === "undefined" ? "../external/bcmaps/" : "../web/cmaps/",
iccUrl:
typeof PDFJSDev === "undefined" ? "../external/iccs/" : "../web/iccs/",
standardFontDataUrl:
typeof PDFJSDev === "undefined"
? "../external/standard_fonts/"
: "../web/standard_fonts/",
wasmUrl: "../web/wasm/", wasmUrl: "../web/wasm/",
iccUrl: "../external/iccs/",
standardFontDataUrl: "../external/standard_fonts/",
useWorkerFetch: true, useWorkerFetch: true,
pdfBug: true, pdfBug: true,
CanvasFactory: DebugCanvasFactory, CanvasFactory: DebugCanvasFactory,