Closed Bug 1487467 Opened 7 years ago Closed 1 year ago

Print to PDF text not selectable and rasterized on Ubuntu (for text printed with fillText() API in mozPrintCallback)

Categories

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

x86
Linux
defect

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox61 --- affected
firefox62 --- affected
firefox63 --- affected

People

(Reporter: laszlo.bialis, Unassigned)

References

()

Details

Attachments

(3 files)

[Affected versions]: Latest Nightly 63.0a1 Latest Beta 62.0 Latest Release 61.0.2 [Affected platforms]: Ubuntu 16.04 x32 [Steps to reproduce]: Launch Firefox Nightly. Navigate to https://bugzilla.mozilla.org/attachment.cgi?id=8798493 From the menu select Print Then Print to PDF Inspect the saved file [Expected result]: The "Test" text under "... loading print" sections must be vectorized and selectable. [Actual result]: The "Test" text is not selectable and seems to be rasterized (see attached testnightlycomparedpdf.PNG ) compared to the same PDF saved from Win10. [Additional notes]: The issue is present on Ubuntu only. also attaching the PDF files genearted from Ubuntu and Win10
Attached file testnightlyubuntu.pdf
Attached file testnightlywin10.pdf
Summary: Print to PDF text not selectable and rasterized on Ubuntu → Print to PDF text not selectable and rasterized on Ubuntu (for text printed with fillText() API in mozPrintCallback)
I can reproduce back a long way (on Linux Mint here), with and without e10s enabled. The bug 1308259 patch was specifically for macOS, so unsurprisingly, I can reproduce even after that landed. Do we need to add any special handling in DrawTargetCairo::CreateSimilarDrawTarget for whatever surface type we're using on Linux?
Flags: needinfo?(jwatt)
Priority: -- → P3
I suspect we do. Something matching whatever surface type we end up getting when calling gfxPlatformGtk::CreateOffscreenSurface: https://dxr.mozilla.org/mozilla-central/rev/17c314f6930d2b8d6e456aa9e9d41407a45c3008/gfx/thebes/gfxPlatformGtk.cpp#127 We would need the surface type to have the concept of "layers" and for cairo to expose that to us. (If not then our only option for correct rendering is to draw into a raster image and composite it unfortunately.) From a quick look at the following search results I'm not seeing anything promising: https://dxr.mozilla.org/mozilla-central/search?q=_surface_create_ path%3Agfx%2Fcairo%2Fcairo%2Fsrc%2Fcairo- ext%3Ah It's also possible that switching to using Skia PDF on Linux (bug 1322653) would fix this.
Flags: needinfo?(jwatt)
Severity: normal → S3

Similar challenge using Firefox version 127 on Debian 12 Bookworm at https://bugzilla.mozilla.org/show_bug.cgi?id=1906126

(In reply to laszlo.bialis from comment #0)

[Actual result]:
The "Test" text is not selectable and seems to be rasterized (see attached
testnightlycomparedpdf.PNG ) compared to the same PDF saved from Win10.

This bug here seems to have been fixed at some point. Printing to the "Save to PDF" target in Firefox Nightly 131.0a1 today, both "Test" strings on the 2nd and 4th lines of the resulting PDF are selectable.

(This is better than what we were getting on Win10 when this bug was filed -- the Win10 PDF attachment here has not-selectable "Test" text at the left edge of the 2nd and 4th lines. Whereas now under Ubuntu when I print the testcase to PDF, that text is selectable.)

--> Resolving as WORKSFORME.

(In reply to Francewhoa (Francois Carpentier) from comment #5)

Similar challenge using Firefox version 127 on Debian 12 Bookworm at https://bugzilla.mozilla.org/show_bug.cgi?id=1906126

Minor followup, this user was hitting a different issue from this bug; their issue seemed to affect all content (not specific to canvas/mozPrintCallback as the testcase here was).

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: