Fix pdf-parse import - use named import instead of default import

This commit is contained in:
Torsten Schulz (local)
2025-10-22 13:02:22 +02:00
parent 0f6663ef63
commit 4cd73f5760
7 changed files with 155 additions and 155 deletions

View File

@@ -1,5 +1,5 @@
import multer from 'multer'
import pdf from 'pdf-parse'
import pdfParse from 'pdf-parse'
import fs from 'fs/promises'
import path from 'path'
@@ -54,7 +54,7 @@ export default defineEventHandler(async (event) => {
// PDF-Text extrahieren
const pdfBuffer = await fs.readFile(file.path)
const pdfData = await pdf(pdfBuffer)
const pdfData = await pdfParse(pdfBuffer)
// Text in HTML-Format konvertieren (einfache Formatierung)
const htmlContent = convertTextToHtml(pdfData.text)