Closed Bug 1774631 Opened 2 months ago Closed 2 months ago

Printing a PDF as Save to PDF produces rasterized output

Categories

(Core :: Graphics, defect)

Unspecified
All
defect

Tracking

()

VERIFIED FIXED
104 Branch
Tracking Status
firefox-esr102 --- verified
firefox102 --- wontfix
firefox103 --- verified
firefox104 --- verified

People

(Reporter: jrmuizel, Assigned: jfkthame, NeedInfo)

References

Details

Attachments

(1 file)

Printing https://bugzilla.mozilla.org/attachment.cgi?id=9279413 and choosing Save To PDF causes us to get rasterized output.

Blocks: 1772225
Severity: -- → S2
OS: Unspecified → Windows

This applies to Linux too, I imagine we are using the same Cairo backend?

Summary: Save to PDF on Windows produces rasterized output → Printing to PDF as Save to PDF on Windows produces rasterized output
Summary: Printing to PDF as Save to PDF on Windows produces rasterized output → Printing a PDF as Save to PDF on Windows produces rasterized output

There's a typo in the condition here, which results in returning CAIRO_INT_STATUS_UNSUPPORTED
in cases where that shouldn't be necessary. Fixing this gets me nice vector PDF output.

The bug is still present in upstream cairo trunk, so I'll report it there as well.

Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/27ed4770342d
Fix typo in cairo-pdf-surface.c that causes us to get spuriously-rasterized PDF output. r=jrmuizel
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch

I'd suggest uplifting this to 103 and ESR 102.

See Also: 1274502
Duplicate of this bug: 1274502
Duplicate of this bug: 1386573
OS: Windows → All
Summary: Printing a PDF as Save to PDF on Windows produces rasterized output → Printing a PDF as Save to PDF produces rasterized output

Note that the fix here is specific to the Firefox Save to PDF destination. Some of these linked issues also refer to output via the Microsoft Print to PDF driver or to a physical printer, which presumably won't be affected/improved by this.

Comment on attachment 9283052 [details]
Bug 1774631 - Fix typo in cairo-pdf-surface.c that causes us to get spuriously-rasterized PDF output. r=jrmuizel

Beta/Release Uplift Approval Request

  • User impact if declined: Poor result when a pdf.js doc is printed to the Save to PDF destination on Windows or Linux.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce: On Windows / Linux:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): trivial fix for an erroneous condition that throws us off the happy code path
  • String changes made/needed:
  • Is Android affected?: Yes

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Pre-rasterized output when saving a PDF is a really bad user experience -- poor rendering, no searchability, etc. ESR users should not have to suffer that.
  • User impact if declined: Poor result when a pdf.js doc is printed to the Save to PDF destination on Windows or Linux.
  • Fix Landed on Version: 104
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): trivial fix
Attachment #9283052 - Flags: approval-mozilla-esr102?
Attachment #9283052 - Flags: approval-mozilla-beta?

It would be good if we could get a test for this some how.

Flags: needinfo?(jfkthame)

Comment on attachment 9283052 [details]
Bug 1774631 - Fix typo in cairo-pdf-surface.c that causes us to get spuriously-rasterized PDF output. r=jrmuizel

Approved for 103 beta 2, thanks.

Attachment #9283052 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Flags: qe-verify+
QA Whiteboard: [qa-triaged]

Reproduced this issue on an affected Nightly build from 2022-06-16, on Windows 10 x64.
Verified as fixed on Firefox 103.0b3 (20220629123958 - treeherder build) and Firefox 104.0a1 (20220629070023) on Win 10 and Ubuntu 22.04.

Waiting for the issue to be fixed in Firefox 102esr.

Comment on attachment 9283052 [details]
Bug 1774631 - Fix typo in cairo-pdf-surface.c that causes us to get spuriously-rasterized PDF output. r=jrmuizel

Approved for 102.1esr.

Attachment #9283052 - Flags: approval-mozilla-esr102? → approval-mozilla-esr102+

Verified as fixed on Firefox 102.1.0esr (20220718131551) on Windows 10 and Ubuntu 22.04.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-triaged]
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.