From be58fced93762753fd8e1e1936ea39dbabe90727 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Sat, 27 Apr 2024 08:45:52 +0100 Subject: [PATCH] Desktop: Fixes #10056: Fixed error when processing certain PDF files for OCR --- packages/lib/shim-init-node.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/lib/shim-init-node.ts b/packages/lib/shim-init-node.ts index 942b824be..eb5a1c26d 100644 --- a/packages/lib/shim-init-node.ts +++ b/packages/lib/shim-init-node.ts @@ -771,7 +771,11 @@ function shimInit(options: ShimInitOptions = null) { }; const loadPdf = async (path: string) => { - const loadingTask = pdfJs.getDocument(path); + const loadingTask = pdfJs.getDocument({ + url: path, + // https://github.com/mozilla/pdf.js/issues/4244#issuecomment-1479534301 + useSystemFonts: true, + }); return await loadingTask.promise; };