-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Nodejs crash when processing PDF file with pdfjs #2349
Comments
That error appears to say that Node ran out of memory while creating a large ImageData object. If you can trim your example down to figure out which line it crashes at (or step through it line-by-line with a debugger until it crashes), that would be useful. |
I don't think it is related to out-of-memory errors.
const canvas = Canvas.createCanvas(width, height, 'svg'); to const canvas = Canvas.createCanvas(width, height); i.e. remove "svg", the error does not occur. |
By using const renderTask = page.render(renderContext);
await renderTask.promise; Statements after the |
I tried logging an issue with pdfjs thinking it may be related, but they closed the issue saying it seems to be node-canvas related since the code works fine in firefox. |
I am having the same issue on a 1 page PDF! Error
|
Issue
nodejs crashes when processing a PDF file containing an image. Enclosed the PDF file too.
The crash is as follows:
Steps to Reproduce
The following sample is taken from pdfjs example here: customized a bit to output an SVG file.
Your Environment
"canvas": "^2.11.2" and
"pdfjs-dist": "^4.0.379"`v18.18.2
sample.pdf
The text was updated successfully, but these errors were encountered: