Low Quality Print Output of PDFs (Mac OS)

UNCONFIRMED
Unassigned

Status

()

defect
--
major
UNCONFIRMED
6 years ago
3 years ago

People

(Reporter: david.leibovic, Unassigned)

Tracking

Trunk
x86
macOS
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Reporter

Description

6 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Firefox/24.0 (Beta/Release)
Build ID: 20130910160258

Steps to reproduce:

Printing a PDF from pdf.js results in blurry output.
Reporter

Updated

6 years ago
Component: Untriaged → Graphics
Product: Firefox → Core
Version: 24 Branch → Trunk
Reporter

Updated

6 years ago
Severity: normal → major
Reporter

Comment 1

6 years ago
Hello,

I am an engineer at http://etsy.com/ on the Shipping Labels team. We have 200,000 users on Etsy who are onboarded to print shipping labels. These users purchase ~40,000 shipping labels per day. Firefox is the desktop browser of choice for 15-20% of our users.

When a shipping label is purchased, it is downloaded as a PDF. The user prints the PDF and affixes it to their package.

Printing PDFs using Firefox is a constant struggle. Headers and footers are often left on by default, which can invalidate the label. Furthermore, the printed output of PDF.js is blurry, which can lead to inaccurate barcode scans at the post office.

When users write to our support team complaining about blurry PDF printouts from Firefox, we tell them that they can download the PDF and print it from Adobe Reader, or they can switch browsers.

Please see examples here: http://fastcheetahs.com/FF_bug_811002.zip
In this ZIP you will find several files:
CanadaPost_Adobe.pdf - A scanned Canada Post shipping label printed using Adobe Reader. It is clear & crisp.
CanadaPost_FF.pdf - A scanned Canada Post shipping label printed using Firefox (PDF.js). It is blurry.
CanadaPost_Original.pdf - The original Canada Post shipping label PDF file.
USPS_Adobe.pdf - A scanned USPS shipping label printed using Adobe Reader. It is clear & crisp.
USPS_FF.pdf - A scanned USPS shipping label printed using Firefox (PDF.js). It is blurry.
USPS_Original.pdf - The original USPS shipping label PDF file.

These PDFs were all viewed and printed from OS X 10.8.2

Hopefully this bug can be fixed soon, and we can stop turning users away from Firefox!

Best regards,
David Leibovic

Comment 2

6 years ago
Thanks for reporting this David.

> Headers and footers are often left on by default, which can invalidate the label.

This should be fixed by bug 839916, isn't it?

> Furthermore, the printed output of PDF.js is blurry, which can lead to inaccurate barcode scans at the post office.

I took a look at "CanadaPost_Original.pdf". My setup is like this:

OSX 10.9, Firefox UX Nightly 2013-10-25. The PDF was opened using the online version of PDF.JS at:

  http://mozilla.github.io/pdf.js/web/viewer.html

The document "CanadaPost_Original.pdf" was printed to a PDF again using the OSX's SaveAsPDF option from the print dialog. As I opened the saved PDF again, I was able to select the text again. That means, the text, that Firefox saved to the PDF using PDF.JS stayed there and did not get rasterised.

With this, I am wondering why the fonts at "CanadaPost_FF.pdf" are such blurry. 

@David, are you sure you use the same print optinos (quality, color, ...) when printing using Firefox/PDF.JS compared to printing using Adobe Reader?
Flags: needinfo?(david.leibovic)
Reporter

Comment 3

6 years ago
(In reply to Julian Viereck from comment #2)
> Thanks for reporting this David.
> 
> > Headers and footers are often left on by default, which can invalidate the label.
> 
> This should be fixed by bug 839916, isn't it?

Good point. Yes, I believe it is fixed now.

> 
> > Furthermore, the printed output of PDF.js is blurry, which can lead to inaccurate barcode scans at the post office.
> 
> I took a look at "CanadaPost_Original.pdf". My setup is like this:
> 
> OSX 10.9, Firefox UX Nightly 2013-10-25. The PDF was opened using the online
> version of PDF.JS at:
> 
>   http://mozilla.github.io/pdf.js/web/viewer.html
> 
> The document "CanadaPost_Original.pdf" was printed to a PDF again using the
> OSX's SaveAsPDF option from the print dialog. As I opened the saved PDF
> again, I was able to select the text again. That means, the text, that
> Firefox saved to the PDF using PDF.JS stayed there and did not get
> rasterised.
> 
> With this, I am wondering why the fonts at "CanadaPost_FF.pdf" are such
> blurry. 
> 
> @David, are you sure you use the same print optinos (quality, color, ...)
> when printing using Firefox/PDF.JS compared to printing using Adobe Reader?

Yes, as far as I can tell, I am using the same print quality settings in both cases. I can also confirm the behavior you are seeing -- when I go to Print > Save As PDF from the PDF.js print dialog in OS X, everything is crisp, and text stays as text. It is only when a hard paper copy is printed from PDF.js that the blurriness ensues.
Flags: needinfo?(david.leibovic)
Note that bug 811002 has the Windows only fix.

Comment 5

6 years ago
Thanks for getting back at me David!

(In reply to david.leibovic from comment #3)

> > @David, are you sure you use the same print optinos (quality, color, ...)
> > when printing using Firefox/PDF.JS compared to printing using Adobe Reader?
> 
> Yes, as far as I can tell, I am using the same print quality settings in
> both cases. I can also confirm the behavior you are seeing -- when I go to
> Print > Save As PDF from the PDF.js print dialog in OS X, everything is
> crisp, and text stays as text. It is only when a hard paper copy is printed
> from PDF.js that the blurriness ensues.

What does a web page printed with Firefox looks like for you? Is the text blurred similarly to the blurring you see when printing using PDF.JS?
Flags: needinfo?(david.leibovic)
Reporter

Comment 6

6 years ago
(In reply to Julian Viereck from comment #5)

> What does a web page printed with Firefox looks like for you? Is the text
> blurred similarly to the blurring you see when printing using PDF.JS?

A normal (non-PDF) webpage does not look blurry when printed.
Flags: needinfo?(david.leibovic)

Comment 7

5 years ago
I am in an almost identical situation to that of @david. My product is also a shipping label that is held to quality standards in its physical (printed) medium. Firefox\PDF.js is consistently showing poor results in this area and as a result my product is often unscannable and degraded. Tossing in a vote for this.

Comment 8

4 years ago
It looks like one can reproduce this bug in OS X without needing a physical printer. In the OS X "Print" dialog, choose "Save as Postscript…" instead of "Save as PDF…" If you then open up the .ps file, you'll see that the text is unselectable, and, if you zoom in, it is badly pixelated.
Jet, who do we have on PDF.js?
Flags: needinfo?(bugs)
Yury: can you help track this down? How/why does PDF.js rasterize text and shapes for printing as described in comment 8 ?
Flags: needinfo?(bugs) → needinfo?(ydelendik)
(In reply to Jet Villegas (:jet) from comment #10)
> Yury: can you help track this down? How/why does PDF.js rasterize text and
> shapes for printing as described in comment 8 ?

Printing of the PDF.js is based on the mozPrintCallback (bug 745025). During onbeforeprint PDF.js creates canvases for each page. (Theoretically resolution shall not be important, however proportions are). Each canvas has mozPrintCallback attached, and PDF.js paints page content on the provided by the API 2d context (no rasterization is happening at PDF.js side). 

There are few exceptions for small amount of PDF: a PDF contains blending/composition operations, in this intermediate canvases needs to be created at some resolution, and content shall be painted there then composed. I don't think it's related to comment 8, since "Save as PDF..." does not rasterize the output.
Flags: needinfo?(ydelendik)
I did some more testing this morning, and found a few interesting tidbits:

- With a physical printer, my sample PDF (simple text) is printing just fine. From comment 11, it sounds like that's what is expected, with the exception of a few PDF operations. Are any of the other reporters on this bug still able to reproduce it?
- "Save as PDF…" still functions as expected (i.e. high-quality).
- "Save as PostScript…" still gives low-resolution output. Printing *this* HTML page shows *both* pixelated text and sharp text, apparently depending on the font—so perhaps the "Save as PostScript…" is a separate issue from PDF.js entirely? Sorry if the "Save as PostScript…" was a red herring…

Comment 13

4 years ago
I had previously done some printing samples here. 

https://github.com/mozilla/pdf.js/issues/4706#issuecomment-43330713

Comment 14

4 years ago
(In reply to David Alan Hjelle from comment #12)
> - "Save as PDF…" still functions as expected (i.e. high-quality).
> - "Save as PostScript…" still gives low-resolution output. Printing *this*
> HTML page shows *both* pixelated text and sharp text, apparently depending
> on the font—so perhaps the "Save as PostScript…" is a separate issue from
> PDF.js entirely? Sorry if the "Save as PostScript…" was a red herring…

Short fly-by comment: The output gets rasterized if the Cairo backend (which is used in Firefox to generate the PDF and PostScript output) does not support all the drawing operations used when generating the output. That means it can happen that the CairoPDF backend supports all the drawing operations (and therefore the information can stay as vector graphics in the PDF) while this is not the case for the PostScript output (and as a fall-back solution Cairo starts rasterizing the resulting image before storing it in the PostScript file). 

Note that in the past we had problems that the PDF output got also rasterized, which you find more information about in bug 811002 and the link [1] from the Cairo Mailing list.

[1]: http://lists.cairographics.org/archives/cairo/2012-May/023084.html
Reporter

Comment 15

4 years ago
(In reply to David Alan Hjelle from comment #12)
> - With a physical printer, my sample PDF (simple text) is printing just
> fine. From comment 11, it sounds like that's what is expected, with the
> exception of a few PDF operations. Are any of the other reporters on this
> bug still able to reproduce it?

Hi David, I am still able to reproduce this issue on Firefox 37.0.2, Mac OS 10.8.5. Please see my comment #1 for examples.
You need to log in before you can comment on or make changes to this bug.