From 9d50a3b261c48cbcce53e0cb055de6d26b9bbcb6 Mon Sep 17 00:00:00 2001 From: Oskar Okuno <2677573+MrOggy85@users.noreply.github.com> Date: Fri, 2 Oct 2026 12:27:15 +0900 Subject: [PATCH] Fix: ship pdf.js CMaps so CJK documents render in the viewer (#14318) Co-authored-by: Claude Opus 5 Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com> --- src-ui/angular.json | 5 +++++ .../common/pdf-viewer/pdf-viewer.component.spec.ts | 1 + .../app/components/common/pdf-viewer/pdf-viewer.component.ts | 1 + 3 files changed, 7 insertions(+) diff --git a/src-ui/angular.json b/src-ui/angular.json index c3801947d..633be88c5 100644 --- a/src-ui/angular.json +++ b/src-ui/angular.json @@ -91,6 +91,11 @@ "glob": "**/*", "input": "node_modules/pdfjs-dist/iccs/", "output": "/assets/iccs/" + }, + { + "glob": "**/*", + "input": "node_modules/pdfjs-dist/cmaps/", + "output": "/assets/cmaps/" } ], "styles": [ diff --git a/src-ui/src/app/components/common/pdf-viewer/pdf-viewer.component.spec.ts b/src-ui/src/app/components/common/pdf-viewer/pdf-viewer.component.spec.ts index bb64cee1f..a3f47abae 100644 --- a/src-ui/src/app/components/common/pdf-viewer/pdf-viewer.component.spec.ts +++ b/src-ui/src/app/components/common/pdf-viewer/pdf-viewer.component.spec.ts @@ -90,6 +90,7 @@ describe('PngxPdfViewerComponent', () => { withCredentials: true, wasmUrl: expect.stringContaining('/paperless/assets/wasm/'), iccUrl: expect.stringContaining('/paperless/assets/iccs/'), + cMapUrl: expect.stringContaining('/paperless/assets/cmaps/'), }) }) diff --git a/src-ui/src/app/components/common/pdf-viewer/pdf-viewer.component.ts b/src-ui/src/app/components/common/pdf-viewer/pdf-viewer.component.ts index a4a9dbd19..7994e82be 100644 --- a/src-ui/src/app/components/common/pdf-viewer/pdf-viewer.component.ts +++ b/src-ui/src/app/components/common/pdf-viewer/pdf-viewer.component.ts @@ -190,6 +190,7 @@ export class PngxPdfViewerComponent withCredentials: true, wasmUrl: new URL('assets/wasm/', this.document.baseURI).toString(), iccUrl: new URL('assets/iccs/', this.document.baseURI).toString(), + cMapUrl: new URL('assets/cmaps/', this.document.baseURI).toString(), } this.loadingTask = getDocument(initOptions) try {