Merge pull request #20865 from Snuffleupagus/internal-viewer-urls

Bundle the necessary files and set the correct `cMapUrl`, `iccUrl`, and `standardFontDataUrl` when building `gulp internal-viewer`
This commit is contained in:
Tim van der Meij 2026-03-13 21:02:30 +01:00 committed by GitHub
commit f4c6fff759
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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,