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

TypeError: Cannot read property 'free' of undefined #318

Closed
ValerioMarsala opened this issue Sep 25, 2023 · 0 comments
Closed

TypeError: Cannot read property 'free' of undefined #318

ValerioMarsala opened this issue Sep 25, 2023 · 0 comments

Comments

@ValerioMarsala
Copy link

ValerioMarsala commented Sep 25, 2023

I have the following error reading this file:
error.pdf

TypeError: Cannot read property 'free' of undefined
at XRef_getEntry [as getEntry] (eval at (/node_modules/pdf2json/lib/pdf.js:62:1), :5704:16)
at XRef_fetch [as fetch] (eval at (/node_modules/pdf2json/lib/pdf.js:62:1), :5723:16)
at Catalog.get metadata [as metadata] (eval at (/node_modules/pdf2json/lib/pdf.js:62:1), :4932:30)
at LocalPdfManager_ensure [as ensure] (eval at (/node_modules/pdf2json/lib/pdf.js:62:1), :32512:22)
at LocalPdfManager.BasePdfManager_ensureCatalog [as ensureCatalog] (eval at (/node_modules/pdf2json/lib/pdf.js:62:1), :32459:19)
at Object.parseSuccess [as onResolve] (eval at (/node_modules/pdf2json/lib/pdf.js:62:1), :27114:42)
at Object.runHandlers (eval at (/node_modules/pdf2json/lib/pdf.js:62:1), :864:35)
at listOnTimeout (internal/timers.js:557:17)
at processTimers (internal/timers.js:500:7)
Cannot read property 'free' of undefined

pdfParser.on("pdfParser_dataError", errData => {
  reject(errData.parserError)
});
pdfParser.on("pdfParser_dataReady", pdfData => {
  //.....
})
pdfParser.loadPDF(path)
modesty added a commit that referenced this issue May 6, 2024
modesty added a commit that referenced this issue May 11, 2024
modesty added a commit that referenced this issue May 24, 2024
…tion handlings (#346)

* feat: add eslint, fix issue #321, add test PDF for #321:image exception will only be warned in log, won't stop the text and form parsing

* fix: issue #318, fixed together with #321

* fix: issue #343, resolve pkInfo at build time

* fix: issue #255 and #277, keep parsing if img data is not resolved

* maint: add ts dependency and config, remove root pdf2json.js, use ./bin/pdf2json.js instead

* maint: replace lib/p2jcom*.js with src/cli/p2jcli*.ts, compied cli is moved to /bin/cli

* maint: add compiled bundle to bin/cli and dist

* maint: remove unnecessary build artifacts

* build: add prepare scripts

* test: add more page content verification in test

* test: add more cli tests after jest

* fix: auto create output dir in CLI to make more tests run without setting up directory structure

* fix: #262: correct the condition check, also add i262_4hXzVq.pdf to test/misc
@modesty modesty closed this as completed May 25, 2024
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