feat(labs): PDF upload, text extraction, LLM draft pipeline
This commit is contained in:
7
server/src/lib/pdf.ts
Normal file
7
server/src/lib/pdf.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { extractText, getDocumentProxy } from "unpdf";
|
||||
|
||||
export async function pdfToText(data: Uint8Array): Promise<string> {
|
||||
const doc = await getDocumentProxy(data);
|
||||
const { text } = await extractText(doc, { mergePages: true });
|
||||
return text;
|
||||
}
|
||||
Reference in New Issue
Block a user