Printing a PDF as Save to PDF produces rasterized output
Categories
(Core :: Graphics, defect)
Tracking
()
People
(Reporter: jrmuizel, Assigned: jfkthame)
References
Details
Attachments
(1 file)
48 bytes,
text/x-phabricator-request
|
dmeehan
:
approval-mozilla-beta+
RyanVM
:
approval-mozilla-esr102+
|
Details | Review |
Printing https://bugzilla.mozilla.org/attachment.cgi?id=9279413 and choosing Save To PDF causes us to get rasterized output.
Reporter | ||
Comment 1•2 years ago
|
||
It looks like this is happening because we hit this case: https://searchfox.org/mozilla-central/source/gfx/cairo/cairo/src/cairo-pdf-surface.c#7566
Updated•2 years ago
|
Comment 2•2 years ago
|
||
This applies to Linux too, I imagine we are using the same Cairo backend?
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 3•2 years ago
|
||
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.
Updated•2 years ago
|
Assignee | ||
Comment 4•2 years ago
|
||
I've submitted https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/336 upstream about this.
Updated•2 years ago
|
Comment 6•2 years ago
|
||
bugherder |
Comment 7•2 years ago
|
||
I'd suggest uplifting this to 103 and ESR 102.
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 10•2 years ago
|
||
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.
Assignee | ||
Comment 11•2 years ago
|
||
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:
- Load https://bugzilla.mozilla.org/attachment.cgi?id=9279413
- Choose Print / Save to PDF
- Open the resulting PDF in a viewer (e.g. Adobe Reader)
- Check that it has selectable text, and remains clear when zooming in
- 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
Reporter | ||
Comment 12•2 years ago
|
||
It would be good if we could get a test for this some how.
Comment 13•2 years ago
|
||
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.
Comment 14•2 years ago
|
||
bugherder uplift |
Updated•2 years ago
|
Updated•2 years ago
|
Comment 15•2 years ago
|
||
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 16•2 years ago
|
||
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.
Comment 17•2 years ago
|
||
bugherder uplift |
Comment 18•2 years ago
|
||
Verified as fixed on Firefox 102.1.0esr (20220718131551) on Windows 10 and Ubuntu 22.04.
Assignee | ||
Comment 19•2 years ago
|
||
(In reply to Jeff Muizelaar [:jrmuizel] from comment #12)
It would be good if we could get a test for this some how.
Generally, we don't have very extensive test coverage for PDF output; that would be a good enhancement to our test infrastructure, but for now it's not clear to me what we can do here (besides manual testing).
Description
•