modesty / pdf2json

converts binary PDF to JSON and text, for server-side PDF processing and command-line use.

Home Page:https://github.com/modesty/pdf2json

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

All PDF Parsing fails after upgrading from v3.1.2 to v3.1.3

DanLambe opened this issue · comments

I created integration tests for comparing PDFs using this library and started with version 3.1.2 within my repo. I noticed the types weren't working and copied the types in manually and cam up with a work around for the noisy console statements mentioned in previous issues. I saw the updated version and upgraded hoping the noisy console statements and typing issues were fixed. The typing issue does appear to be fixed with this version, but now all my tests fail with the following error and stacktrace when trying to parse any PDFs.

Error: Page 5: t.warn is not a function TypeError: t.warn is not a function at le.clearRect (file:///my-directory/node_modules/pdf2json/lib/pdfcanvas.js:289:12) at e.beginDrawing (file:///my-directory/node_modules/pdf2json/lib/pdfjs-code.js:40589:18) at e.initalizeGraphics (file:///my-directory/node_modules/pdf2json/lib/pdfjs-code.js:43623:16) at Object.onResolve (file:///my-directory/node_modules/pdf2json/lib/pdfjs-code.js:42920:32) at Object.runHandlers (file:///my-directory/node_modules/pdf2json/lib/pdfjs-code.js:889:28) at listOnTimeout (node:internal/timers:573:17) at processTimers (node:internal/timers:514:7)