Skip to content

Unable to find other page content #280

@eeh456456

Description

@eeh456456

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions