mozilla / pdf.js

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

Open pdf with color issue #14591

Closed justalways closed 2 years ago

justalways commented 2 years ago

Attach (recommended) or Link to PDF file here: MTB_8ft_Tower_2.pdf

Configuration:

Steps to reproduce the problem:

  1. Original file opened on the computer. KSCgXdM_dq-_UyUr1VZ_8J1mK6vJ-vFbog

  2. open in pdf viewer

Wj_m5qHph0zo_I-BlPfwfX6m2NylgWtekw

The color is bright about top area, help please!

Snuffleupagus commented 2 years ago

WFM, using PDF.js version 2.13.133 in either Firefox Nightly 99 or Google Chrome Beta 99; note the following screen-shot:

page1

Web browser and its version: chrome

Please provide the actual version number, since as-is this information is incomplete.

PDF.js version: master branch

Again, please provide an actual version number to remove confusion about the tested version.

  1. Original file opened on the computer.

There's also no mention of which exact PDF Viewer this screen-shot was captured from, since the colours don't seem to completely match the rendering in Adobe Reader (i.e. the PDF reference implementation).


Closing as WORKSFORME, since I cannot reproduce this and given that the issue unfortunately doesn't really contain enough information in order to be actionable/valid.

calixteman commented 2 years ago

The blues are not exactly the same for me on Windows 11, Firefox nightly and Acrobat Pro DC (2021.011.20039): Screenshot 2022-02-21 103512

With Acrobat, the blue has the value #23408F when it's #0E3692 with Firefox.

Snuffleupagus commented 2 years ago

The blues are not exactly the same for me on Windows 11,

A very slight different is probably unavoidable here, given that the ColorSpace conversion in PDF.js (for /DeviceCMYK in this case) favours speed over perfect fidelity; note https://github.com/mozilla/pdf.js/blob/3635a9a3338feb0049be4f1521d5a5afd173a832/src/core/colorspace.js#L824-L888

justalways commented 2 years ago

@Snuffleupagus Thank you for your explanation。 Do you want to optimize it?

Snuffleupagus commented 2 years ago

Do you want to optimize it?

As already mentioned above, the implementation is optimized for performance (at the cost of rendering fidelity).

Snuffleupagus commented 2 years ago

Duplicate of #2218