-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Print is fuzzy/blurry #2750
Comments
I'd guess it's because the pdf.js output is a canvas (one canvas per page, to be exact), which probably doesn't match 100% the printer resolution. |
Any solution? i'm in a hotline and i have 200 users with this problem. |
@BadFriend, @musiphil, what operating system you or your users use? |
Same issue here on FFox 19 on WinXP to PostScript printer. The fine horizontal lines are dithered, while the vertical lines are fine. Headers and footers are fine as well. |
I'm running Firefox 19.0 on Windows 7, and I printed those documents to a HP Color LaserJet CP4525 printer with PCL6. |
FF19 + Win7 64bit + OKI561 via PCL6 on WSD Port or Adobe PDF (Adobe Acrobat 9.2.0) left: Chrome Plugin Download PDF -> http://www.file-upload.net/download-7241349/offers-36.pdf.html |
See also #2771. Quoting @brendandahl:
|
The upstream bug has been fixed. Is this still an issue with the latest versions of Firefox and PDF.js? |
I think it was only fixed for Windows. There is a new bug filled for OSX (bug 932313) but I am not convinced it is valid (see my comment at https://bugzilla.mozilla.org/show_bug.cgi?id=932313#c2). Until the issue is not fixed on Linux, I vote for keeping this bug open. |
Is it fixed? from Chrome and Chromium print result is SO blurry, I can't find words to describe it Am I missing something? |
@jonny64 thanks for reporting this! Unfortinate, I guess there is not much that can be done for Chrome/Chromium here. The better print quality in Firefox results by using a special API for printing that is available in Firefox but not in Chrome. Back in the days I proposed the API as a standard but there was not much interest and therefore it is still only available in Firefox. |
:) @jviereck, well, ok, I should live with it Fortunatly, I have some backgound with C some time ago |
This is still a bug on OS X and the latest Firefox Dev Edition, as far as I can tell, at least in some circumstances. How to reproduce without a printer:
Text is not selectable and, zooming in, the text is quite pixelated. Text looks great if you chose "Save as PDF…" |
I tried increasing the default resolution in
and web/pdf_page_view.js::beforePrint
Printing is slower but quality has improved |
Some improvements after #7677 |
Have there been any updates to this issue in the past 4 months? This is still noticeable on the latest version of pdf.js. I recently rolled out a deployment using pdf.js and now have documents printing with a fuzzy letters that weren't a problem with Chrome's native PDF reader. You can reproduce this issue by printing from Mozilla's own demo page. I know it isn't a driver issue because it happens when you print to a PDF as well. It looks like some people using pdf.js in production have had to bypass pdf.js entirely to work around this issue (example). |
Currently, higher quality printing is not possible without greatly increasing memory usage, which most browsers won't take well. The canvas back-end cannot provide such functionality. There is a project open (https://github.com/mozilla/pdf.js/projects) to research using the prototype SVG back-end for high quality printing. |
I have found the PDF.js has had acceptable print quality and fuzzy print quality depending on the version of Firefox installed so would like to take a look at what has changed between the versions I was able to print from. I have https://imgur.com/7Beh7MO, which is output from a direct print from left to right of Firefox 52, 47.0.2, and 42, with the first two at least being fresh updates. As shown, something changed in PDF.js between FF 47.0.2 and FF 52 releases that seems to have crapped up the quality, so if anyone has info on what bookmarks to look at to start with for those versions of Firefox, I wouldn't mind taking a look to start. |
Looking at the Firefox repository versions of PDF.js, I see that 47.0.2 was version 1.4.121, which corresponds to commit 51f6aba (might be the commit after, which is be1e12d) and that Firefox 52 shipped with PDF.js 1.6.315, which is roughly commit c23f124. I am currently looking into diffing these commits, but the difference between them is probably 400 commits and any information on where printing lies would be very helpful. |
While it's certainly possible that a change in PDF.js is responsible, I wouldn't (at least initially) entirely discount the possibility that the issue could be related to e.g. graphics/printing code in other parts of Firefox. |
Does the print button inside of PDF.js even use Firefox to print? My
assumption based on the fact that the plugin is available in other browsers
is that there wouldn't be any issues related to how the underlying browser
handles printing. This is also supported by the print processing dialogue
listing PDF.js rendering as a task to send the data to the printer. I will
do some additional testing and try and run PDF.js as a plugin and test
different versions of possible to see if that changes anything.
…On Mar 14, 2017 9:58 AM, "Jonas Jenwald" ***@***.***> wrote:
As shown, something changed in PDF.js between FF 47.0.2 and FF 52 releases
that seems to have crapped up the quality,
While it's certainly possible that a change in PDF.js is responsible, I
wouldn't (at least initially) entirely discount the possibility that the
issue could be related to e.g. graphics/printing code in other parts of
Firefox.
It may be helpful, and perhaps even quicker, to use
http://mozilla.github.io/mozregression/ to try and find a regression
range.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2750 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AOZHcyFJnLjI8MhAXspe-SIikmMA7YWOks5rlpzwgaJpZM4AcblL>
.
--
Please click to read Notices:
http://www.mediweightlossclinics.com/sig/ Confidential Communication
http://www.mediweightlossclinics.com/sig/ Educational Purposes Disclaimer
http://www.mediweightlossclinics.com/sig/ Franchise Disclosure Statement
|
Previously, we used the Mozilla-specific In general, we now render the canvases and print them using the regular browser-defined printing logic, so I think the issue may either be in changed canvas scaling/font rendering code or a browser bug. Refer to c09f634 for the majority of that change. You might want to check if there is a difference in printing quality from Firefox with and without the add-on. |
Since c09f634 there is now
To change print resolution to 300 DPI, simply change the line below.
According to the release tags, all PDF.js versions from 1.7.x to 1.10.x should have that ability now. I am surprised this is not documented anywhere. Ideally there should be ability to change print resolution from query parameters instead of modifying See How to increase print quality of PDF file with PDF.js viewer for more details. |
If @mpryvkin's fix is legitimate, this should definitely be exposed as an option in about:config. |
@timvandermeij I would love to help provide some of that feedback. After all, about:config is already a warranty-voiding area ;) How can I contribute? Would I need to build Firefox from scratch to change the |
You can experiment with this by opening the default viewer (either https://mozilla.github.io/pdf.js/web/viewer.html which always runs the most recent |
I tried the above method, but I'm getting undefined. |
Yes, running that will give |
Thx. |
This is explained in the comments above, in particular #2750 (comment). We first want to experiment with it before we make it more easily accessible. Note that just a day ago PR #10879 was merged with should help a bit with the memory usage issue, and now that this is at least programmatically settable, we can more easily experiment with it and include improvements. |
We should take a look at all the PDFs here and in linked issues and see if the blurriness would be fixed by https://bugzilla.mozilla.org/show_bug.cgi?id=1774615. |
@thomaskeefe could you upload the original PDF? (you can remove the private info) |
If #2750 (comment) is on a Mac, then it could be another case of bug 1779202. |
@marco-c Attached is the PDF with PII redacted. After redacting, I printed it again with Firefox PDF.js as a check; the barcodes were still mangled. @Snuffleupagus yes I am using a Mac. |
Let me give the following suggestion to increase the print quality, at least on Mac and modern Linux clients when PDF.js is running embedded in Firefox and not as a library. PDF.js already load the internal representation of the PDF so it would not be impossible to extract the content of the original pages selected for printing and generate a new PDF scaled and rotated to the output page size and orientation. When that PDF is ready, it can be submitted natively as a PDF to the local IPP Server, currently macOS and Linux use CUPS as the IPP frontend to all printer. I know this works because this is what I do on Linux for an internally developed PDF viewer for Java based on pdfium. Instead of sending rendered images to the printer, I use the pdfium API to generate a new PDF, rotate and scale the pages and add the user selected pages to the new PDF. After that I use Java Print Service API to get printers that understand PDF natively, that on modern Linux are all, because CUPS is the IPP frontend for them. Firefox on Linux already link in some way with CUPS for printing, so adding a internal API to submit the generated PDF is possible, if it doesn't already exist. |
Copying my post from Closed #15933 Hi @Snuffleupagus, I'm not sure if I understand correctly. I have tried setting printResolution option in Chrome console for my document in https://mozilla.github.io/pdf.js/web/viewer.html, as instructed in #2750 (comment), for example: PDFViewerApplicationOptions.set('printResolution', 300) but the blurry still persists when printing (I have tried multiple resolutions: 300, 600 and 1200; also 60 to confirm that the property is applied through Chrome Console) |
Why is it that when you open a PDF file in Firefox, click on the print icon, it prints the PDF correctly without converting it to a Bitmap image, but when you use the PDF viewer in PDF.js, it prints as an image? |
if i print a pdf with FF19 and the new pdf function the print is blurry.
if i print with acrobat the font is clear.
left= acrobat
right = ff pdf
have you an idea?
https://plus.google.com/105533044232180103026/posts/dYL855pBkSM
The text was updated successfully, but these errors were encountered: