This repository has been archived on 2026-01-31. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
pdf-text-parsing/utils/parser.ts
2024-05-07 21:52:38 +02:00

13 lines
275 B
TypeScript

import PdfParse from 'pdf-parse';
export async function parser(file: File) {
const chunks = [];
for await (const chunk of file.stream() as any) {
chunks.push(chunk);
}
const parsedContent = await PdfParse(Buffer.concat(chunks));
return parsedContent.text;
}