Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Fuzzy Printing

273 views
Skip to first unread message

Brian Marble

unread,
Mar 25, 2016, 5:48:32 PM3/25/16
to dev-p...@lists.mozilla.org
Hello,



I am upgrading our 12 year old document viewer with pdf-js. I am using pdfjs
V1.3.



When printing docs they appear fuzzy, especially the fonts. Not awful
hideous fuzzy, just some pixelation. I have done a fair bit of testing to
locate and verify the problem.



Any given pdf, like 'tracemonkey' , looks fine in the viewer. When I print
there is pixelation (extra dots) around each letter in the doc. This can be
clearly seen with a common magnifying glass. To the naked eye the printed
document looks fuzzy and to many, acceptable. My application, like many
others, demands the same print quality whether it is printed with pdfjs or
with acrobat reader.



When I download the same doc and print it from Acrobat Reader, it is crystal
clear. No pixelation.



I have tried this from my application and also from the current example at
http://mozilla.github.io/pdf.js/web/viewer.html?file=compressed.tracemonkey-
pldi-09.pdf, using Chrome and Firefox. The same results always happen.



Are there any bug fixes in the pipeline that resolve this issue beyond V
1.3? Is there any fine tuning that I can do with pdfjs code that would
resolve this isssue.



Thank you for your efforts with pdfjs. I greatly appreciate it.



Regards,

Brian



___________

Brian Marble

Gen Manager

LandEZ Inc

Jeremy Bramwell

unread,
Mar 26, 2016, 12:19:54 AM3/26/16
to mozilla-d...@lists.mozilla.org
I'm not a pdfjs contributer or expert by any means, so take this with a lump of salt.

I think the basic issue is that PDFjs renders the pdf using canvas, and this means that when printing you are essentially sending a bitmapped image to the printer with the fonts rendered at the dpi of the canvas. The canvas is meant for writing to the screen (72 dpi) and your printer is generally 300dpi+. It looks like there has been some effort in the past to rerender the canvas at a higher dpi, but that seems to be resource intensive and thus slow or prone to crash on resource restricted devices like ipads.

Looking at the github issues I see a number of issues related to print quality.
https://github.com/mozilla/pdf.js/labels/4-printing

this one describes loosely how printing works in firefox vs other browsers.
https://github.com/mozilla/pdf.js/issues/6060

This issue seems to include a pull request that works around this in chrome by handing the pdf off directly to chromium's build it pdf viewer, PDFium.
https://github.com/mozilla/pdf.js/pull/6190

some other issues that might be of interest:
https://github.com/mozilla/pdf.js/issues/2750

so it looks like the best print results occur in firefox because it exposes a special API to allow proper page/margin sizing and it allows for higher dpi rendering (i think). You do have to set the about:config setting layout.css.font-loading-api.enabled to false. Otherwise you get full resolution rendering of the wrong font(s).

chrome should be good if the change to use pdfium for the printing is applied and if it works. There may be cases where that solution has to fall back to canvas rendering, e.g. password protected files.

For all other browsers it appears that your mileage may vary.
0 new messages