Closed Bug 2091728 Opened 8 days ago Closed 5 days ago

PDF Viewer prints thin lines with way too much thickness, with Skia GDI (Brother MFC-L8390CDW series)

Categories

(Core :: Printing: Output, defect)

Firefox 160
defect

Tracking

()

VERIFIED FIXED
162 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr153 --- unaffected
firefox160 --- fixed
firefox161 --- fixed
firefox162 --- fixed

People

(Reporter: lukas.buchs, Assigned: emilio)

References

(Regression)

Details

(Keywords: regression)

Attachments

(5 files, 3 external files)

Attached file Testfile_Firefox.pdf —

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:160.0) Gecko/20100101 Firefox/160.0

Steps to reproduce

Print the file in the attachment in Firefox 160.

Actual results

Since the update to Firefox 160, the PDF Viewer prints lines as large black boxes instead of actual lines. It's only the printer output; the view on screen is correct, and when using 'Microsoft Print to PDF,' there is no problem either.

On a Mac, the problem with Firefox 160 cannot be reproduced either.

Expected results

PDFs should be printed as shown in the preview.

Attached file Print_Scan.pdf —

Scan of the printer output

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

Hmm, I can't reproduce the bug yet -- the attached Testfile_Firefox.pdf prints just fine for me, using Firefox 160 on Windows 11, printing to a Brother HL-2280DW printer.

Can you share what printer you're experiencing the problem on?

Sort of a shot in the dark, but could you try visiting about:config and search forprint.windows.skia-gdi.enabled and toggle that preference to false and see if it helps? (That was a Windows printing change that arrived in Firefox 160, in bug 2079470, which might conceivably cause fallout like this...)

Thanks!

Flags: needinfo?(lukas.buchs)

Yes when setting print.windows.skia-gdi.enabled to false it prints correctly. Printer is a Brother MFC-L8390CDW series .

Flags: needinfo?(lukas.buchs)

when using 'Microsoft Print to PDF,' there is no problem either

That smells like a driver bug then...

Which probably explains why Daniel can't repro. Which particular printer are you using?

Flags: needinfo?(lukas.buchs)

Ah, sorry, missed comment 4.

Flags: needinfo?(lukas.buchs)

We can look at what GDI commands Cairo generates vs. Skia, and try to avoid hitting this somehow...

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(emilio)
Summary: PDF Viewer prints lines as boxes → PDF Viewer prints lines as boxes with Skia GDI (Brother MFC-L8390CDW series)
Summary: PDF Viewer prints lines as boxes with Skia GDI (Brother MFC-L8390CDW series) → PDF Viewer prints thin lines with way too much thickness, with Skia GDI (Brother MFC-L8390CDW series)

(Tentatively triaging as S3, though if there are signs that many users/drivers are affected, we might consider bumping the severity.)

Severity: -- → S3

I'm also having this issue on Brother printer MFC-L8610-CDW and MFC L8930-CDW

2026-11-12T11:46:54.241000: DEBUG : Found commit message:
Bug 2082991 - Support native strokes in SkGDI. r=lsalzman

Loosely based on _cairo_win32_printing_surface_stroke. This makes sure
that these lines remain on the output. Without this change, they go as
a clipped fill, and rounding makes them fade / disappear.

Differential Revision: https://phabricator.services.mozilla.com/D334904

2026-11-12T11:46:54.242000: DEBUG : Did not find a branch, checking all integration branches
2026-11-12T11:46:54.243000: INFO : The bisection is done.
2026-11-12T11:46:54.245000: INFO : Stopped

Brother driver, PCL, Firefox 160.0,
Windows 11

  • 159.0b5 prints correctly; 160.0 does not.
  • Setting print.windows.skia-gdi.enabled = false fixes it.
  • Chrome and Adobe Reader print the same PDF correctly.

mozregression narrowed it to one autoland push:
last good: 8b1345f2
first bad: b7fa022f (160.0a1, build 20261018153642)
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=8b1345f2&tochange=b7fa022f
The push contains bug 2082991 (D334904, "Support native strokes in SkGDI").
So with Skia GDI active, the problem starts when strokes are sent as native GDI
strokes instead of fills.

Captured EMF spool files (Brother MFC-L8610CDW, 600 dpi) of the same page printed
from Firefox 160 (Skia GDI on) and Chrome.

Firefox 160: EMR_EXTCREATEPEN PS_GEOMETRIC|PS_SOLID, width 267 (and 133),
with world transform scale 0.03125 (1/32) set before STROKEPATH.
Intended device width = 267/32 = ~8.3 px = 1pt at 600 dpi.
Chrome: EMR_EXTCREATEPEN PS_GEOMETRIC|PS_SOLID, width 9 (and 5),
world transform ~identity.

The Brother driver appears not to apply the world transform to the geometric pen
width, so the Firefox strokes come out 267 device px (~0.45 in) wide, matching
the solid boxes on paper. Text under the same 1/32 transform prints correctly.
Avoiding a scaled world transform for pen widths (or passing device-space widths,
as Chrome does) would likely avoid it.

Comparison of the stroke pens for the same Testfile_Firefox.pdf, same printer/driver:
Skia GDI (bad): ExtCreatePen PS_GEOMETRIC width 143, world transform 0.03125
cairo (good): ExtCreatePen PS_GEOMETRIC width 4, world transform identity (y-flip)
Chrome (good): ExtCreatePen PS_GEOMETRIC width 5, world transform ~identity

All three use native strokes; only Skia GDI sends the pen width under the 1/32
transform. The Brother driver appears to ignore the world transform for pen width,
so 143 device px is printed.

Since some drivers don't apply it properly. This means we don't get
subpixel stroke widths but that matches Cairo.

Assignee: nobody → emilio
Status: NEW → ASSIGNED
Flags: needinfo?(emilio)
Status: ASSIGNED → RESOLVED
Closed: 5 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch

The patch landed in nightly and beta is affected.

:emilio, please make an uplift decision for beta:

  • For beta, nominate the patch for beta uplift approval if the fix should be included in this release, or set status-firefox161 to wontfix if the fix can wait for the next release.

Uplift requests can be submitted from Lando: D342560.

See Requesting an Uplift for documentation on how to request an uplift.

For more information, please visit BugBot documentation.

Flags: needinfo?(emilio)

Can you confirm that the latest nightly version works as expected on the affected printer?

Flags: needinfo?(emilio) → needinfo?(lukas.buchs)

firefox-beta Uplift Approval Request

  • User impact if declined/Reason for urgency: Recent regression
  • Code covered by automated testing?: no
  • Fix verified in Nightly?: no
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: One liner.
  • String changes made/needed?: None
  • Is Android affected?: no
Attachment #9682980 - Flags: approval-mozilla-beta?

Since some drivers don't apply it properly. This means we don't get
subpixel stroke widths but that matches Cairo.

Original Revision: https://phabricator.services.mozilla.com/D342560

Attachment #9682980 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Duplicate of this bug: 2092900

:emilio, could you consider adding a release uplift request?

Flags: needinfo?(emilio)

Would be nice to confirm the fix on actual hardware first.

Flags: needinfo?(emilio)

Lukas - could we ask you to test a patched build and confirm that this is fixed for you?

Here's a .zip file for a build that'd be good to test -- it's the (not-yet-officially-released) 64-bit Windows build of Firefox Beta, built from the commit that we think should have patched this:
https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/dJK3XOGBS9iz9-BNZJTNww/runs/0/artifacts/public/build/target.zip

Extracting that^ should give you a firefox folder, in which you can run firefox.exe to launch Firefox Beta (which uses a different profile folder from your regular Firefox installation, so it can run alongside it etc). Hopefully your PDF prints fine from that build...

(Ah right, or Emilio mentioned testing latest Nightly in comment 20 too -- you can get that from https://nightly.mozilla.org/ -- which should include the fix at this point, too.)

Justin (comment 10) confirmed via email this is fixed.

Status: RESOLVED → VERIFIED
Flags: needinfo?(lukas.buchs)

firefox-release Uplift Approval Request

  • User impact if declined/Reason for urgency: See above
  • Code covered by automated testing?: no
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: See above.
  • String changes made/needed?: none
  • Is Android affected?: no
Attachment #9683042 - Flags: approval-mozilla-release?

Since some drivers don't apply it properly. This means we don't get
subpixel stroke widths but that matches Cairo.

Original Revision: https://phabricator.services.mozilla.com/D342560

Attachment #9683042 - Flags: approval-mozilla-release? → approval-mozilla-release+

(In reply to Daniel Holbert [:dholbert] from comment #27)

Lukas - could we ask you to test a patched build and confirm that this is fixed for you?

Here's a .zip file for a build that'd be good to test -- it's the (not-yet-officially-released) 64-bit Windows build of Firefox Beta, built from the commit that we think should have patched this:
https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/dJK3XOGBS9iz9-BNZJTNww/runs/0/artifacts/public/build/target.zip

Extracting that^ should give you a firefox folder, in which you can run firefox.exe to launch Firefox Beta (which uses a different profile folder from your regular Firefox installation, so it can run alongside it etc). Hopefully your PDF prints fine from that build...

Hi Daniel

I've downloaded and tested it, it's fixed 🥳 thanks for the fast fix!

QA Whiteboard: [qa-triage-done-c162/b161]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: