Open Bug 1810897 Opened 2 years ago Updated 2 years ago

Firefox does not print PDFs correctly

Categories

(Core :: Printing: Output, defect)

Firefox 108
defect

Tracking

()

UNCONFIRMED

People

(Reporter: sam.d.pollard, Unassigned)

References

(Regression)

Details

(Keywords: regression)

Attachments

(3 files)

Attached image sample of the pages printed (deleted) —

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:108.0) Gecko/20100101 Firefox/108.0

Steps to reproduce:

Using Firefox version 108.0.1, on MacOS v 11.7.2 (Big Sur)
Printing onto an HP Color LaserJet M255dw

  • Open a pdf from arXiv. For example, https://arxiv.org/pdf/2210.15740.pdf
  • File -> Print, options are: fit to page width, black and white, all pages, US Letter, 1 page per sheet, default margin, two-sided printing flip on long edge, do not print headers and footers

Actual results:

The printed document did not contain any text, only some small graphics. It also did not print two-sided.

Expected results:

The print quality and output should be the same as printing by downloading the file and opening it with a pdf reader (in my case, the Preview App).

The Bugbug bot thinks this bug should belong to the 'Core::Printing: Output' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Printing: Output
Product: Firefox → Core

This doesn't reproduce for me on macOS 12.3 (Monterey) using either Firefox 108.0.2 or Nightly (111.0a1), using my Samsung (monochrome) laser printer; the output appears just fine.

If you turn off the option to print two-sided, and try to just print a single page of the document, does that work? (I don't have a duplex-capable printer, so can't try to reproduce exactly what you're doing. But I wonder if that might be a factor in the problem.)

Do you have access to any other printer you can try? It would be helpful to know if the problem is related to a specific printer driver or something like that.

Flags: needinfo?(sam.d.pollard)

Thanks for looking into this. I got the same issue, trying these options. I also updated Firefox to 109.0.

File -> Print: fit to page width, black and white, current page, US Letter, 1 page per sheet, default margin, two-sided printing off, do not print headers and footers

File -> Print: fit to page width, black and white, current page, US Letter, 1 page per sheet, default margin, two-sided printing off, do print headers and footers.

Unfortunately I do not have another printer readily available, but I can look around for one. I also am not able to update MacOS to Monterey because of its age. I suspect the issue is either with the printer or the MacOS version, both of which are on my end and not Firefox.

It's interesting that the arXiv:2210.15740v1 [cs.PL] 27 Oct 2022 sidebar-text prints correctly (shown at the very bottom of your photo). That means things aren't entirely broken; just mostly-broken. :)

I have two questions:
(1) Is anything noticeably broken if you follow your same steps, but choose Firefox's built-in "Save to PDF" print destination (at the top-right of print dialog) instead of your real printer? i.e. if you do that and then open the resulting saved PDF that our print dialog produced, does it look fine or similarly-broken?

(Note that we do perform a synthetic print when you do this, so it's conceivable that the resulting saved PDF might show the same issue. If it does, then that helpfully rules out printer-specific quirks, and it gets us a step closer to understanding how to reproduce.)

(2) Does the bug still happen if you visit about:config, and search for gfx.cairo_quartz_cg_layer.enabled, and toggle that preference to false?

(We changed that preference's default value from false to true in Firefox 108, in bug 1789482. I wonder if that change is involved here, given that you reported this bug in Firefox 108.)

Thanks!

Daniel,

For my answer to (1), the same options with "Save to PDF" destination results in the correct PDF.

In your response to (2), selecting the options

File -> Print: fit to page width, black and white, current page, US Letter, 1 page per sheet, default margin, two-sided printing off, do print headers and footers

after setting gfx.cairo_quartz_cg_layer.enabled to false results in the correct printing output!

To be clear, since I first posted this, I'm now running version 109.01 (64-bit), and the issue is still present if I set gfx.cairo_quartz_cg_layer.enabled to true

Flags: needinfo?(sam.d.pollard)

I also wanted to post a picture, if this helps. You can't see it super well in the photo; the effect is much more noticeable in person, but with gfx.cairo_quartz_cg_layer.enabled == false the print quality is not as sharp. The pages look like a document that was converted to a JPG, then printed, or printed on a low-quality inkjet printer (i.e. the text is not very sharp). I've noticed this in the past with Firefox, which is why as a rule I generally try to print from preview instead of Firefox itself.

It looks like in theory, gfx.cairo_quartz_cg_layer.enabled == true fixes this (except in my case).

You can notice it in the "22" to the left gray text after arXiv:, the "GFX true", despite printing the blank page, has the same sharpness as the "print from preview" - the rest of the text for the "GFX false", for example, looks slightly blurred.

I also wanted to post a picture, if this helps. You can't see it super well in the photo; the effect is much more noticeable in person, but with gfx.cairo_quartz_cg_layer.enabled == false the print quality is not as sharp. The pages look like a document that was converted to a JPG, then printed, or printing on a low-quality inkjet (i.e. the text is not very sharp). I've noticed this in the past with Firefox, which is why as a rule I generally try to print from preview instead of Firefox itself.

It looks like in theory, gfx.cairo_quartz_cg_layer.enabled == true fixes this (except in my case where none of the main text is printed). You can notice that the gray text on the leftmost page looks sharper compared to the center, and in the center picture compared to the right, the main text is more blurry (in the photo, it mostly looks bolder)

Right; the gfx.cairo_quartz_cg_layer.enabled should (in general) enable Firefox to pass vector data through from the PDF to the print output stream, which will then get printed at full resolution by your printer, whereas with that disabled, the PDF gets rasterized to a bitmap image within Firefox and then that (limited-resolution) bitmap gets sent to the printer.

So the quality difference you noticed is exactly as expected, and that's why we want gfx.cairo_quartz_cg_layer.enabled to be the standard setting.

What I don't currently understand is why the main text is failing to print at all for you when that setting is enabled. On my Mac & printer combination, I can't reproduce that issue; it prints fine for me.

Daniel, do you have a machine where you can test this and see if it repro's for you?

Flags: needinfo?(dholbert)

(In reply to Jonathan Kew [:jfkthame] from comment #8)

Daniel, do you have a machine where you can test this and see if it repro's for you?

I tested on my MacBook Pro (15-inch, 2019) with Ventura 13.2, using Firefox release (109) as well as Nightly 111, printing to a Brother HL-2280DW laser printer. Unfortunately, I can't reproduce.

(For what it's worth, I'm selecting "Pages: Current page" in the print dialog to avoid burning 27 sheets of paper with each test. :) I'm leaving all other settings at their defaults.)

Possibly something specific to older macOS versions?

(I'm tagging this as a regression from bug 1789482, since that's where we set the pref to true and enabled this cairo_quartz_cg_layer codepath.)

Regressed by: 1789482

I happen to have an old Mac mini (mid 2011) which is stuck on macOS High Sierra, version 10.13.6. I just powered up that machine for the first time in a few years, from a factory-reset state, and installed Firefox on it to test this bug.

Unfortunately, it did not reproduce this bug. I got a perfectly fine first page of output sent to my printer.

This still might be specific to macOS "big sur" v 11.7.2 (i.e. something ~broken in that version), or specific to something else about Sam's print setup.

Sam, two requests for you:
(1) Could you confirm that "Pages: Current Page" (while viewing the first page) still reproduces the missing-text bug?
(2) Could you try printing with "Color mode: Color" if you've got that option available, and see if that changes anything? (Just printing that first page, to avoid wasting paper/ink). Just in case this is something going wrong with the decolorization step.

Thank you!

Flags: needinfo?(sam.d.pollard)

OK, I installed Big Sur 11.7.3 alongside my existing Ventura installation (dual-booting) on my MacBook Pro, and did a print ("Current page" on the attached PDF, default settings) from a fresh installation of Firefox 109 to my brother printer, and I can't reproduce any missing-text issue there.

So: this doesn't seem to be generally-reproducible-on-Big-Sur. So, presumably specific to Sam's printer or another system-specific or profile-specific setting.

Sorry for the delay. Still having trouble finding another printer to use. But to answer Daniel's two requests:

As before, here are the options. Now we're up to version 110.0.

  1. Copies 1, portrait, Color mode black and white, pages current, gfx.cairo_quartz_cg_layer.enabled == true, US Letter, Fit to page width, 1 page per sheet, default margin, two-sided printing: flip on long edge, do not print headers and footers.

  2. Copies 1, portrait, Color mode color, pages current, gfx.cairo_quartz_cg_layer.enabled == true, US Letter, Fit to page width, 1 page per sheet, default margin, two-sided printing: flip on long edge, do not print headers and footers.

For fun, I tried

  1. Copies 1, portrait, Color mode color, pages current, gfx.cairo_quartz_cg_layer.enabled == true, US Letter, scale 75, 1 page per sheet, default margin, two-sided printing: flip on long edge, do not print headers and footers.

  2. Copies 1, portrait, Color mode color, pages 1-2, gfx.cairo_quartz_cg_layer.enabled == true, US Letter, Fit to page width, 2 pages per sheet, default margin, two-sided printing: flip on long edge, do not print headers and footers.

All of these options still have the same issue, though with the final one the gray tex is rotated as though it's printed two-sided.

I also was successfully able to print this file directly from the browser on both safari and chrome.

I'm happy to chalk this up to old macbook + weird printer issue. I can share my .ppd file also, if that helps.

Flags: needinfo?(sam.d.pollard)

Thank you for all that additional testing and info, Sam!

One final thing that might help, or at least would be useful to try:
(1) visit the special URL about:support
(2) Scroll down to "Modified print settings" and copypaste that whole section into a text file, as a backup (it might be useful, as noted below).
(3) Click the button called "Clear saved print settings" just above that section.
(4) See if you can reproduce the bug.

There's a chance that might fix the issue... And if it does, then some of the settings that you saved in step (2) would presumably be involved in causing the problem; and they might help us reproduce the problem as well. Or if it doesn't fix the issue, that's still useful to know, to rule out possible sources of trouble.

Really appreciate all your assistance here!

(triage note: Triaging as S3 since so far we haven't been able to reproduce, and per notes from the reporter, this seems extremely configuration-specific and we're not sure if many users are affected. If we find out more about the specific required-configuration and it looks like measurable numbers of users are affected, it might be worth bumping the severity here.)

Severity: -- → S3

Triaging works for me. One last follow-up: I cleared all of my modified print settings, there were 108 lines of it, then got the same error while printing with these two settings:

Copies 1, portrait, Color mode color, pages current, gfx.cairo_quartz_cg_layer.enabled == true, US Letter, Fit to page width, 1 page per sheet, default margin, two-sided printing: flip on long edge, do not print headers and footers.

Copies 1, portrait, Color mode black and white, pages all, gfx.cairo_quartz_cg_layer.enabled == true, US Letter, Fit to page width, 1 page per sheet, default margin, two-sided printing: flip on long edge, do not print headers and footers.

For what it's worth, I also accidentally printed more than just the current page, and for example on page 1:3, the output contains all the arrows and boxes. This seems to be some font rendering issue on my printer's end; all the fonts in that pdf are embedded except for Times-Roman (the main text of the pdf is Libertine).

In any case, thank you for taking all the time to investigate. If only HP was this responsive...

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: