mozilla / pdf.js

PDF Reader in JavaScript
https://mozilla.github.io/pdf.js/
Apache License 2.0
48.16k stars 9.95k forks source link

Color elements not displayed, breaking whole PDF file (TypeError: codingStyleParameters is undefined etc.) #12752

Closed rugk closed 3 years ago

rugk commented 3 years ago

Attach (recommended) or Link to PDF file here:

Configuration:

Steps to reproduce the problem:

  1. Go to this link.
  2. Optionally, download PDF file and open it in Firefox.
  3. Optionally, go to https://mozilla.github.io/pdf.js/web/viewer.html and open it there.

What is the expected behavior?

If I open it in Evince 3.38.0 it actually works and is shown in color: grafik

What went wrong?

Everything:

grafik

The following console errors are shown:

In Firefox 83 (stable):

14:36:48.397 Warning: JPX: Trying to recover from: Codestream code 0xFF53 (COC) is not implemented pdf.worker.js:1104:13 14:36:48.398 Warning: Unable to decode image "img_p0_1": "TypeError: codingStyleParameters is undefined". pdf.worker.js:1104:13 14:36:48.400 PDF f2429f9760ebdfea04bae9a312813109 [1.5 RICOH MP C5504 / RICOH MP C5504] (PDF.js: 2.7.99) viewer.js:1351:13 14:36:48.400 Warning: JPX: Trying to recover from: Codestream code 0xFF53 (COC) is not implemented pdf.worker.js:1104:13 14:36:48.400 Warning: Unable to decode image "img_p0_2": "TypeError: codingStyleParameters is undefined". pdf.worker.js:1104:13 14:36:48.523 Warning: Dependent image isn't ready yet 2 pdf.js:1190:13 14:36:48.659 Warning: JPX: Trying to recover from: Codestream code 0xFF53 (COC) is not implemented pdf.worker.js:1104:13 14:36:48.659 Warning: Unable to decode image "img_p1_1": "TypeError: codingStyleParameters is undefined". pdf.worker.js:1104:13 14:36:48.660 Warning: JPX: Trying to recover from: Codestream code 0xFF53 (COC) is not implemented pdf.worker.js:1104:13 14:36:48.661 Warning: Unable to decode image "img_p1_2": "TypeError: codingStyleParameters is undefined". pdf.worker.js:1104:13 14:36:48.773 Warning: Dependent image isn't ready yet 2 pdf.js:1190:13

On https://mozilla.github.io/pdf.js/web/viewer.html:

14:37:20.206 PDF 110dd61fd57444010b1ab5ff38782f0f [1.4 pdfeTeX-1.21a / TeX] (PDF.js: 2.7.395) app.js:1672:4 14:37:28.352 Warning: JPX: Trying to recover from: Codestream code 0xFF53 (COC) is not implemented pdf.worker.js:1067:13 14:37:28.353 Warning: Unable to decode image "img_p0_1": "TypeError: codingStyleParameters is undefined". pdf.worker.js:1067:13 14:37:28.355 Warning: JPX: Trying to recover from: Codestream code 0xFF53 (COC) is not implemented pdf.worker.js:1067:13 14:37:28.355 Warning: Unable to decode image "img_p0_2": "TypeError: codingStyleParameters is undefined". pdf.worker.js:1067:13 14:37:28.359 PDF f2429f9760ebdfea04bae9a312813109 [1.5 RICOH MP C5504 / RICOH MP C5504] (PDF.js: 2.7.395) app.js:1672:4 14:37:28.473 Warning: Dependent image isn't ready yet 2 util.js:358:4 14:37:28.604 Warning: JPX: Trying to recover from: Codestream code 0xFF53 (COC) is not implemented pdf.worker.js:1067:13 14:37:28.604 Warning: Unable to decode image "img_p1_1": "TypeError: codingStyleParameters is undefined". pdf.worker.js:1067:13 14:37:28.608 Warning: JPX: Trying to recover from: Codestream code 0xFF53 (COC) is not implemented pdf.worker.js:1067:13 14:37:28.608 Warning: Unable to decode image "img_p1_2": "TypeError: codingStyleParameters is undefined". pdf.worker.js:1067:13 14:37:28.722 Warning: Dependent image isn't ready yet 2 util.js:358:4 14:37:31.893 Warning: JPX: Trying to recover from: Codestream code 0xFF53 (COC) is not implemented pdf.worker.js:1067:13 14:37:31.894 Warning: Unable to decode image "img_p2_1": "TypeError: codingStyleParameters is undefined". pdf.worker.js:1067:13 14:37:31.895 Warning: JPX: Trying to recover from: Codestream code 0xFF53 (COC) is not implemented pdf.worker.js:1067:13 14:37:31.895 Warning: Unable to decode image "img_p2_2": "TypeError: codingStyleParameters is undefined". pdf.worker.js:1067:13 14:37:32.023 Warning: Dependent image isn't ready yet 2 util.js:358:4

Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):

As said, in all version of PDF.js that are used I see an error, this includes:

timvandermeij commented 3 years ago

Fixed by the PR above.

rugk commented 3 years ago

Wow, that was fast. Thanks a lot! :smiley: :tada:

Happy weekend and happy holidays! /cc @Snuffleupagus