import { errorMessage } from "./utils.js"; export async function extractPdfBuffer(buffer: ArrayBuffer): Promise { const { getDocumentProxy, extractText } = await import("unpdf"); const pdf = await getDocumentProxy(new Uint8Array(buffer)); const { text } = await extractText(pdf, { mergePages: true }); return text ?? ""; }