Closed Bug 1661720 Opened 4 years ago Closed 4 years ago

Microsoft Print to PDF stuck in printing only Color outputs

Categories

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

All
Windows
defect

Tracking

()

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

People

(Reporter: emilghitta, Assigned: emilio)

References

(Blocks 1 open bug, Regression)

Details

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

Attachments

(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:

https://searchfox.org/mozilla-central/rev/2fb77a351ab34e9994f01377e2e12486a50f1737/widget/windows/nsDeviceContextSpecWin.cpp#448

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:

https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-devicecapabilitiesa

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 ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d979307c639f Don't claim to support monochrome for known PDF printers. r=jwatt
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8cbbcc11ba1b Move monochrome detection to nsIPrinter. r=bobowen
Priority: -- → P2
Status: NEW → RESOLVED
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.

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

Attachment

General

Created:
Updated:
Size: