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

ReferenceError: MozBlobBuilder is not defined #103

Closed
dss886 opened this issue Feb 6, 2022 · 1 comment
Closed

ReferenceError: MozBlobBuilder is not defined #103

dss886 opened this issue Feb 6, 2022 · 1 comment

Comments

@dss886
Copy link

dss886 commented Feb 6, 2022

I'm using parseFileItems() method to parse a pdf as same as the code in pdfreader/parse.js.

But the callback has been called only once (where only item.file has value). No error has been throw.

When i pass the { debug: true } to the constructor of pdfreader, a stacktrace shows up.

Is this a bug or am I using it wrong?

➜  pdfreader node parse.js ~/Desktop/test.pdf
printing raw items from file: /Users/dss886/Desktop/test.pdf ...
file = /Users/dss886/Desktop/test.pdf
Warning: Setting up fake worker.
Warning: Unhandled rejection: ReferenceError: MozBlobBuilder is not defined
ReferenceError: MozBlobBuilder is not defined
    at Object.createBlob (eval at <anonymous> (/Users/dss886/Workspace/Scripts/billing/node_modules/pdf2json/lib/pdf.js:64:1), <anonymous>:1104:12)
    at Object.createObjectURL (eval at <anonymous> (/Users/dss886/Workspace/Scripts/billing/node_modules/pdf2json/lib/pdf.js:64:1), <anonymous>:1112:24)
    at JpegStream_getIR [as getIR] (eval at <anonymous> (/Users/dss886/Workspace/Scripts/billing/node_modules/pdf2json/lib/pdf.js:64:1), <anonymous>:25575:18)
    at PartialEvaluator_buildPaintImageXObject [as buildPaintImageXObject] (eval at <anonymous> (/Users/dss886/Workspace/Scripts/billing/node_modules/pdf2json/lib/pdf.js:64:1), <anonymous>:7120:64)
    at PartialEvaluator_getOperatorList [as getOperatorList] (eval at <anonymous> (/Users/dss886/Workspace/Scripts/billing/node_modules/pdf2json/lib/pdf.js:64:1), <anonymous>:7464:24)
    at Object.eval [as onResolve] (eval at <anonymous> (/Users/dss886/Workspace/Scripts/billing/node_modules/pdf2json/lib/pdf.js:64:1), <anonymous>:4348:26)
    at Object.runHandlers (eval at <anonymous> (/Users/dss886/Workspace/Scripts/billing/node_modules/pdf2json/lib/pdf.js:64:1), <anonymous>:864:35)
    at listOnTimeout (node:internal/timers:557:17)
    at processTimers (node:internal/timers:500:7)

Other information:

  1. Run npm test: All tests passed
  2. Run node parse.js test/sample.pdf: All content of sample pdf printed
  3. Version: pdfreader 1.2.14, pdf2json 1.2.5
@dss886
Copy link
Author

dss886 commented Feb 7, 2022

I just found the same issue #101 with a solution...

@dss886 dss886 closed this as completed Feb 7, 2022
adrienjoly pushed a commit that referenced this issue Apr 23, 2022
By @copmerbenjamin:

* Update pdf2json to version 2
MozBlobBuilder is not defined in newer versions of node, pdf2json 2 resolves this but drops node versions below 14 (#101, #103, #114)

* BREAKING CHANGE: drop support for Node.js < 14

* Increase ecmaVersion, according to node.js version upgrade
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

1 participant