Closed Bug 1661720 Opened 4 years ago Closed 4 years ago

Microsoft Print to PDF stuck in printing only Color outputs


(Core :: Printing: Setup, defect, P2)




82 Branch
Tracking Status
firefox-esr68 --- unaffected
firefox-esr78 --- unaffected
firefox80 --- unaffected
firefox81 --- disabled
firefox82 + verified


(Reporter: emilghitta, Assigned: emilio)


(Blocks 1 open bug, Regression)


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


(3 files)

Attached image Color2.gif

Affected versions

  • 82.0a1 (BuildId:20200827212940)
  • 81.0b3 (BuildId:20200827203325)

Affected platforms

  • Windows 10 64bit

Unaffected platforms

  • Ubuntu 20.04 64bit
  • macOS 10.14

Steps to reproduce

  1. Launch Firefox.
  2. Access any random webpage.
  3. Hit CTRL + P.
  4. Select the “Microsoft Print to PDF” option from the destination menu.
  5. Change between "black & white" and "color" options from the Color mode dropdown menu.

Expected result

  • The changes reflect inside the print preview and in actual print output.

Actual result

  • The change doesn’t reflect in print preview nor in the actual print output.

Regression Window

  • This seems to be a regression. I will investigate this asap.

Additional Information

  • For further information regarding this issue please observe the attached screencast.
  • [Suggested severity] S2
Has Regression Range: --- → no
Has STR: --- → yes
QA Whiteboard: [qa-regression-triage]

Using mozregression I tracked this down to bug 1660986. Emilio, can you take a look at this?

Flags: needinfo?(emilio)
Regressed by: 1660986

Pretty sure this is bug 1661645.

Depends on: 1661645
Flags: needinfo?(emilio)

(Removing the whiteboard tag for easier tracking.)

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

Bug 1661645 has landed in m-c but I can still reproduce this issue using Firefox 82.0a1 (BuildId:20200901214943) test page

Adding the [print2020_81] tag back for now.

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

Based on the regressing bug, and that we get the "supportsColor" and "supportsMonochrome" from the platform side, I think this is a platform bug… (Fortunately, Emilio is already cc-ed on it. 😉)

Component: Printing → Printing: Setup
Product: Toolkit → Core

Odd, I can take a look.

Flags: needinfo?(emilio)

Mark S2 for now (and thanks for taking a look at this, Emilio.)

Severity: -- → S2

Works for me on buildid: 20200902215721 on my Windows 10 laptop.

Okay, I could reproduce this. To reproduce it, probably the color mode option had been disabled once (by changing destination to one which is not color available).

Assignee: nobody → emilio
Flags: needinfo?(emilio)

They don't. Right now we get to GetDataFromPrinter from
nsDeviceContextSpecWin with mPrintInColor = false, but this copy back
and forth ends up setting it to true:

Even if you avoid that, the printed file ends up being in color. This is
a bit of a hack, the right long-term fix is to detect whether the
printer supports monochrome in Gecko (add an attribute to nsIPrinter)
and communicate it to the front-end.

There's no equivalent to DC_COLORDEVICE but for monochrome in:

I think we could check if DC_FIELDS returns the COLOR field or such.
I'll poke at doing that but this is less risky.

This moves the special cases to the printing platform code instead
(where it belongs).

The SupportsMonochrome() implementation is the only thing that I found
to work for the "Microsoft Print to PDF" driver, but other similar
drivers like XPS still claim to support monochrome (even though it's not
true). This should avoid the UI getting in a bad state as described in
the bug though, so may be better?

Depends on D89306

Pushed by
Don't claim to support monochrome for known PDF printers. r=jwatt
Pushed by
Move monochrome detection to nsIPrinter. r=bobowen
Priority: -- → P2
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch

Is this something we need to take on Beta still or can this ride 82 to release?

Flags: needinfo?(emilio)

It can ride.

Flags: needinfo?(emilio)
Flags: qe-verify+

Reproduced the initial issue using old Nightly build (2020-08-28), verified that using Firefox 82.0b3 the Color Mode section is grayed out and disabled for Microsoft Print to PDF and Save to PDF.

Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.