Closed Bug 1660911 Opened 4 years ago Closed 4 years ago

Printing from PDF.js or exporting PDF using B&W mode rasterizes output at low quality

Categories

(Core :: Printing: Output, defect, P1)

defect

Tracking

()

RESOLVED FIXED
82 Branch
Tracking Status
firefox-esr68 --- unaffected
firefox-esr78 --- unaffected
firefox80 --- wontfix
firefox81 --- fixed
firefox82 --- fixed

People

(Reporter: svoisen, Assigned: emilio)

References

(Regression)

Details

(Keywords: regression, Whiteboard: [print2020_v81] [old-ui+])

STR

  1. Open any PDF document in Firefox and view using PDF.js. For instance, I used the CA DMV form found here: https://www.dmv.ca.gov/portal/uploads/2020/06/reg135.pdf
  2. Click the print button from the viewer interface.
  3. Print to a physical printer.

Content seems to be rasterized at low quality. Text is blurry and pixelated.

Regression Info

Running mozregression (that was a fun waste of paper!) gives the following:
Last good revision: 432e42cbbc4139efd2319952ec33efe8ff9add3c
First bad revision: 35cdd8678bbfed2d652deb2d7105494e366f1a0e

https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=432e42cbbc4139efd2319952ec33efe8ff9add3c&tochange=35cdd8678bbfed2d652deb2d7105494e366f1a0e

Keywords: regression
Whiteboard: [print2020_v81]

This looks like it was regressed by bug 1659753. I don't see anything else that stands out in the list.

Regressed by: 1659753

I don't see how that patch would have changed print behavior. There are a number of print related changes in that changeset that look suspicious. FWIW, when regressions like this have happened in the past, it's been in gfx code e.g. using the wrong surface type or performing operations on a surface that cause it to be rasterized.

All of the print changes in the changeset are frontend related, so they don't seem to be the issue.

That said, "performing operations on a surface that cause it to be rasterized" is a good hint. In the new print preview UI, selecting "Black and White" mode is what is causing the problem (Color works fine). I believe we apply a filter to the cloned document to apply the B&W affect. Oddly, I don't see that in the changeset, so maybe something went wrong with mozregression.

Emilio: I think you worked on the B&W filter in bug 1631449. Thoughts?

Flags: needinfo?(emilio)
Regressed by: 1631449
No longer regressed by: 1659753
Has Regression Range: --- → yes
Summary: Printing from PDF.js rasterizes as low quality → Printing from PDF.js rasterizes as low quality when printing in B&W

It appears that even if you print using the system dialog (going through the new tab modal) and the print preview was rendered using B&W, you also get low print quality. See bug 1660784.

Severity: -- → S3
Component: PDF Viewer → Printing: Output
Priority: -- → P1
Product: Firefox → Core
Summary: Printing from PDF.js rasterizes as low quality when printing in B&W → Printing from PDF.js or exporting PDF using B&W mode rasterizes output at low quality

I checked what Chrome does here and I don't see the Color option for macOS at all (save to PDF or physical printer).

On Windows, I did see that the printed PDF in Nightly is blurrier using B&W mode.

Assignee: nobody → emilio

Set release status flags based on info from the regressing bug 1631449

Black and white quality issues should be fixed in bug 1660857. Should we leave this for PDF.js?

Flags: needinfo?(emilio)

This seems to affect the old ui as well.

Whiteboard: [print2020_v81] → [print2020_v81] [old-ui+]

Reminding myself to retest this with and without PDF.js.

Status: NEW → ASSIGNED
Flags: needinfo?(svoisen)

I can confirm this is resolved in both old and new UI with the fix for bug 1660857.

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Flags: needinfo?(svoisen)
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch
You need to log in before you can comment on or make changes to this bug.