mozilla / pdf.js

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

Using canvas is very terrible in pdf viewer #16739

Closed zxlgh closed 1 year ago

zxlgh commented 1 year ago

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

Steps to reproduce the problem:

  1. open any pdf file.

What is the expected behavior? (add screenshot) more clear text What went wrong? (add screenshot) the text is blurry Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):

Snuffleupagus commented 1 year ago

Seems fine to me, when using PDF.js 3.9.130 [71f113bf8] in Firefox Nightly 117.0a1 on Windows 11.


Note that the ISSUE_TEMPLATE specifically ask for screenshots, so please provide that!

zxlgh commented 1 year ago

Thanks for you reply!

This is suspected to be due to the html canvas rendering used, not the rendering method like pdf software, eg, Adobe Acrobat.

Following is display effect in PDF.js:

pdf

This is the display effect in Adobe Acrobat extension in chrome: adobe

Looking forward to your reply!

Snuffleupagus commented 1 year ago

I'm not really seeing any "blurriness" in Firefox, which is the primary development target for the PDF.js library; see

rendering


However please keep in mind that the rendering quality of a canvas is ultimately controlled by the browser, operating system, and graphics drivers used, hence it's unfortunately not clear what (if anything) we can do about this here since we can't remove canvas-usage for rendering.