A fast, helpful, and open-source document parser
fix: resolve standard font loading failure in Node.js
saravananravi083246599bd7fb
diff --git a/src/engines/pdf/pdfjsImporter.ts b/src/engines/pdf/pdfjsImporter.tsindex 1b4b918..fb6d9b8 100644--- a/src/engines/pdf/pdfjsImporter.ts+++ b/src/engines/pdf/pdfjsImporter.ts@@ -1,9 +1,13 @@+import { fileURLToPath } from "node:url";+import { dirname } from "node:path";+export async function importPdfJs() {const pdfUrl = new URL("../../vendor/pdfjs/pdf.mjs", import.meta.url);const pdfjs = await import(pdfUrl.href);+ const dirPath = dirname(fileURLToPath(pdfUrl));return {fn: pdfjs.getDocument,- dir: pdfUrl,+ dir: dirPath,};}