- android app
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 55s

- code import fix
This commit is contained in:
Torsten Schulz (local)
2026-08-10 15:15:11 +02:00
parent 616bade9a5
commit 5f2de5e671
93 changed files with 693 additions and 1 deletions

View File

@@ -806,7 +806,9 @@ class PDFParserService {
}
static async extractPdfTextWithLayout(filePath) {
const { default: pdfjsLib } = await import('pdfjs-dist/legacy/build/pdf.js');
// pdfjs-dist v5 publishes the legacy build as an ESM module (.mjs) and
// exposes getDocument as a named export (there is no default export).
const pdfjsLib = await import('pdfjs-dist/legacy/build/pdf.mjs');
const pdfData = new Uint8Array(fs.readFileSync(filePath));
const loadingTask = pdfjsLib.getDocument({ data: pdfData, disableWorker: true });
const pdf = await loadingTask.promise;