Skip to content

Image fails to render in PDF with warning: Unable to decode image "img_p1_1": "TypeError: dict is undefined". #14814

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

Closed
nvandermark opened this issue Apr 21, 2022 · 2 comments · Fixed by #14815

Comments

@nvandermark
Copy link

The following PDF document contains an image on the second page, which renders fine in Chrome and Edge, but not in Firefox.

dummy.png-merged.pdf

Configuration:

  • Web browser and its version: Firefox 99.0.1 (64-bit)
  • Operating system and its version: Microsoft Windows 10.0.19044
  • PDF.js version: 2.14.13
  • Is a browser extension: No, built-in

Steps to reproduce the problem:

  1. Download the attached PDF document
  2. Open it with Firefox

What is the expected behavior?
dummy-pdf-preview

What went wrong?
dummy-pdf-error

The console log reports the following:

PDF a6a48131e71621bc3b94ef303411a8c1 [1.6 OpenOffice.org 2.1 / Writer] (PDF.js: 2.14.13)
Warning: Unable to decode image "img_p1_1": "TypeError: dict is undefined".
Warning: Dependent image isn't ready yet

Additional information:
This PDF document is generated by a software component that we've built in Java, based on a number of open-source libraries. It merges an existing PDF document with a number of supplied images to produce a final PDF document.

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Apr 21, 2022

The following PDF document contains an image on the second page, which renders fine in Chrome and Edge, but not in Firefox.

Please note that it also doesn't render in Adobe Reader, which is the PDF reference implementation.

This PDF document is generated by a software component that we've built in Java, based on a number of open-source libraries. It merges an existing PDF document with a number of supplied images to produce a final PDF document.

Unfortunately the generated PDF document is actually corrupt, please refer to #14815 (comment) for additional details.
Hence please also file a bug report against the PDF generator, such that it starts generating valid documents.

@nvandermark
Copy link
Author

Thank you for the quick reply, we'll take this back to improve the PDF generation. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants