-
Notifications
You must be signed in to change notification settings - Fork 10.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
pdf file decode success but not show anything #8270
Comments
The problem may be in function decodeRefinement() (jbig2.js) in the following lines:
As the JBIG2 standard says, offsetX and offsetY should be subtracted, not added. So the lines should be like this:
See page 21 in standard ITU T.88, in which the offsets are called GRREFERENCEDX and GRREFERENCEDY. The JBIG2 images in the PDF use decodeRefinement() to refine symbol bitmaps. Because of this bug, wrong contextLabel bits are fed to the arithmetic decoder. The decoder gets "confused" and it no longer returns valid decoding results. |
@janpe2 it works, thanks so much. |
@janpe2 Could you open a pull request for that bugfix ? |
@janpe2 Very nice debugging, thank you! It seems that this has been broken ever since JBIG2 support was first added, all the way back in PR #1837. Interestingly, in the test-case added in that PR all offsets are
The contribution work-flow is described in https://github.com/mozilla/pdf.js/wiki/Contributing, if you feel like trying it yourself. [1] I just ran the PDF.js test-suite (locally) with your changes, and everything seemed to work just fine :-) |
@Snuffleupagus I would be happy if you could create the patch, please. I think I don't have enough skills to follow the contribution work-flow. In the credits you can mention my name Jani Pehkonen. |
Thank you very much. It worked. Actually, for me, the function decodeRefinement() is in pdf.worker.js |
Link to PDF file (or attach file here): PDF file
Configuration:
Steps to reproduce the problem:
What went wrong? (add screenshot)

this file have many content, but in viewer, is no content to display.
The text was updated successfully, but these errors were encountered: