modesty / pdf2json

converts binary PDF to JSON and text, for server-side PDF processing and command-line use.
https://github.com/modesty/pdf2json
Other
1.98k stars 378 forks source link

TypeError: infoDict.has is not a function #186

Open ElModdy opened 5 years ago

ElModdy commented 5 years ago

TypeError: infoDict.has is not a function at PDFDocument.get documentInfo [as documentInfo] (eval at (/home/usr/repos/Work1/node_modules/pdf2json/lib/pdf.js:64:1), :4638:24) at LocalPdfManager_ensure [as ensure] (eval at (/home/usr/repos/Work1/node_modules/pdf2json/lib/pdf.js:64:1), :32503:22) at LocalPdfManager.BasePdfManager_ensureModel [as ensureModel] (eval at (/home/usr/repos/Work1/node_modules/pdf2json/lib/pdf.js:64:1), :32442:19) at Object.parseSuccess [as onResolve] (eval at (/home/usr/repos/Work1/node_modules/pdf2json/lib/pdf.js:64:1), :27104:38) at Object.runHandlers (eval at (/home/usr/repos/Work1/node_modules/pdf2json/lib/pdf.js:64:1), :864:35) at listOnTimeout (internal/timers.js:535:17) at processTimers (internal/timers.js:479:7) An error occurred while parsing the PDF: infoDict.has is not a function An error occurred while parsing the PDF: infoDict.has is not a function

modesty commented 2 years ago

please upload your testing PDF

paulroth3d commented 1 year ago

Hi @modesty / @ElModdy, I'm unsure if this is the same issue, but I think it is.

I put an example pdf in a gist here:

https://gist.github.com/paulroth3d/9b47d9edc776f7243582da65961bbd79

I did notice, that the problem may have something to do with multiple pages in pdfs.

Once I extracted out the page I wanted from the PDF, then the issue went away.