Replies: 1 comment 1 reply
-
You can change the verbosity level: Lines 429 to 433 in 567df42 Do you have a pdf you can share with us causing a crash or blank page ? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Attach (recommended) or Link to PDF file
scanned-document-error.pdf
Web browser and its version
Chrome
Version 129.0.6668.58 (Official Build) (arm64)
Operating system and its version
MacOS - Sonoma 14.6.1
Is the bug present in the latest PDF.js version?
Yes
Is a browser extension
No
Steps to reproduce the problem
with https://mozilla.github.io/pdf.js/web/viewer.html open developer tools in your browser of choice (I used Chrome).
Open the attached document and notice that in the developer tools console we get the error
Warning: decodeScan - unexpected MCU data, current marker is: ffff
around 600~ timesWhat is the expected behavior?
Not getting warning logs for decodeScan
What went wrong?
In the viewer.html, this does not cause any noticeable disruption to the document.
However, in a React application that uses pdf.js (in my case it was version 4.5.136 with legacy), this error sometimes causes extreme load times and in worst case scenarios, completely blank pdf or crashes in the browser.
This seems to happen more with larger documents.
I'll leave a React pdf component that reproduces this error (This code is just to give an idea how the pdf is rendered in our application):
Additional context
I have encountered this issue with few documents, I am not sure if the problem lies in the pdf document it self or if this is a bug in pdf.js.
I have tried validating the pdf to check if it is corrupt but everything seems fine.
The warning is thrown in src/core/jpg.js, which might be because the pdf document is scanned.
Any idea what precisely causes this?
Beta Was this translation helpful? Give feedback.
All reactions