// Current: PDF.js on main thread with its internal worker import * as pdfjsLib from "pdfjs-dist"; import pdfWorker from "pdfjs-dist/build/pdf.worker.min.mjs?url"; // PDF.js handles rendering/decoding in its own worker pdfjsLib.GlobalWorkerOptions.workerSrc = pdfWorker; // Our parsing logic runs on main thread export async function extractPdfText(file: File): Promise { const buffer = await file.arrayBuffer(); const pdf = await pdfjsLib.getDocument({ data: buffer }).promise; // ... text extraction logic }