fix: improve pdf parsing with pdfjs-dist fallback
Test Suite / test (24.x) (push) Has been cancelled
Test Suite / test (24.x) (push) Has been cancelled
This commit is contained in:
@@ -298,7 +298,9 @@ export class ReceiptParsingService {
|
||||
for (let i = 1; i <= pdfDocument.numPages; i++) {
|
||||
const page = await pdfDocument.getPage(i);
|
||||
const textContent = await page.getTextContent();
|
||||
const pageText = textContent.items.map(item => item.str).join(' ');
|
||||
const pageText = textContent.items
|
||||
.map((item: any) => (item.str ? item.str : ''))
|
||||
.join(' ');
|
||||
fullText += pageText + ' ';
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user