-
Notifications
You must be signed in to change notification settings - Fork 391
Open
Description
I try to parse a 300 page pdf and get the following content:
XXXXXX
----------------Page (0) Break----------------
----------------Page (1) Break----------------
----------------Page (2) Break----------------
----------------Page (3) Break----------------
This is my code:
import PDFParser from "pdf2json";
const pdfParser = new PDFParser(this, 1);
function readPDF(fileName) {
pdfParser.loadPDF(fileName);
pdfParser.on("pdfParser_dataError", errData => console.error(errData.parserError));
pdfParser.on("pdfParser_dataReady", pdfData => {
const data = pdfParser.getRawTextContent()
console.log('文本信息:', JSON.stringify(data)
});
}
readPDF('1.pdf')
Metadata
Metadata
Assignees
Labels
No labels