Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error occurred while parsing the PDF: stream must have data #216

Closed
takoyaro opened this issue Aug 4, 2020 · 1 comment
Closed

An error occurred while parsing the PDF: stream must have data #216

takoyaro opened this issue Aug 4, 2020 · 1 comment

Comments

@takoyaro
Copy link

takoyaro commented Aug 4, 2020

I'm getting An error occurred while parsing the PDF: stream must have data when running basic code.

In my root folder where I've got my index.js, I've got a file called nuclear.pdf
nuclear.pdf

My code is as simple as that:

let pdfParser = new PDFParser();

        pdfParser.on("pdfParser_dataError", errData => console.error(errData.parserError) );
        pdfParser.on("pdfParser_dataReady", pdfData => {
            fs.writeFile("./nuclear.json", JSON.stringify(pdfData));
        });
    
        pdfParser.loadPDF("./nuclear.pdf");

I can clearly see PDF has data. I don't think I've done anything wrong. I'd make a PR but I have no idea how to debug this...

@modesty
Copy link
Owner

modesty commented Aug 9, 2024

verified fix in 3.1.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants