Skip to content
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

Blurry content on a 4K monitor on Windows 10 #10807

Closed
Luuk3333 opened this issue May 10, 2019 · 7 comments
Closed

Blurry content on a 4K monitor on Windows 10 #10807

Luuk3333 opened this issue May 10, 2019 · 7 comments

Comments

@Luuk3333
Copy link

Attach (recommended) or Link to PDF file here:
https://mozilla.github.io/pdf.js/web/viewer.html

Configuration:

  • Web browser and its version: Firefox version 66.0.5
  • Operating system and its version: Windows 10 Pro, version 10.0.17763 Build 17763
  • PDF.js version: 2.2.167
  • Is a browser extension: No

Steps to reproduce the problem:

  1. Attach a 4K monitor to a PC running Windows 10
  2. Change the Firefox preference layout.css.devPixelsPerPx to a value higher than '1'.
  3. Open https://mozilla.github.io/pdf.js/web/viewer.html or a local PDF.

What is the expected behavior?

The content of the PDF should be scaled according to the preference listed above.

What went wrong?

pdf.js displays PDFs blurry when using a 4K monitor on Windows 10. The only preference I have changed to get Firefox set up for a 4K monitor is the preference layout.css.devPixelsPerPx which I've set to '1.9' resulting in Firefox nicely scaling both Firefox and websites on the 27 inch monitor. However, the more that preference is increased the more blurry the built-in viewer displays PDFs. All content of PDFs is blurry, not just text. Also, zooming does not fix the problem.

Here's a comparison between Firefox, Chrome and Edge with the latter two displaying the content correctly:
Screenshot (434)

@brendandahl
Copy link
Contributor

If you leave the pref layout.css.devPixelsPerPx as the default, does the text look okay?

@Luuk3333
Copy link
Author

Luuk3333 commented May 10, 2019

@brendandahl No, still blurry unfortunately :/. The default is '-1.0', which on a 4k monitor is the equivalent of '2'.
Here's a screenshot with preference set to the default:
Screenshot (438)

@Luuk3333
Copy link
Author

Firefox is reporting an incorrect devicePixelRatio of '1'. Forcing it to be '2' by setting the variable devicePixelRatio on line 95 of the file 'web/ui_utils.js' to '2' fixes the issue as the content is now sharp. This is not a pdf.js issue but rather a Firefox issue.

@brendandahl
Copy link
Contributor

@Luuk3333 Did you file a bug upstream with Firefox? https://bugzilla.mozilla.org

@Snuffleupagus
Copy link
Collaborator

This may be related to, or even a duplicate of, https://bugzilla.mozilla.org/show_bug.cgi?id=1537955.

@Luuk3333
Copy link
Author

Luuk3333 commented Jun 5, 2019

@Luuk3333 Did you file a bug upstream with Firefox? https://bugzilla.mozilla.org

I have not. However, Firefox seems to be reporting the correct device pixel ratio since version 67.0.

@tannenfreund87
Copy link

This may be related to, or even a duplicate of, https://bugzilla.mozilla.org/show_bug.cgi?id=1537955.

To connect the issues better, here is the appropriate Firefox bugreport: https://bugzilla.mozilla.org/show_bug.cgi?id=1771184

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

No branches or pull requests

5 participants