Closed Bug 1676191 Opened 4 years ago Closed 4 years ago

[CUPS] In some printers, page is printed with colors even if "Black and white" mode is selected from print preview

Categories

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

defect

Tracking

()

RESOLVED FIXED
Tracking Status
firefox83 --- affected
firefox84 --- affected

People

(Reporter: csasca, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [print2020_v87] [old-ui?])

Attachments

(8 files, 1 obsolete file)

Affected versions

  • Firefox 83.0b4
  • Firefox 84.0a1

Affected platforms

  • Windows 7
  • macOS 10.15.7
  • Ubuntu 20.04

Steps to reproduce

  1. Launch Firefox
  2. Access a page of choice and then print preview it
  3. Select "Black and white" setting from Color mode
  4. Print the page

Expected result

  • The page is printed only in black and white

Actual result

  • The page is still printed with colors

Regression range

  • Tried with a 81.0a1 build with the old modal, but I wasn't able to find a setting to change between black and white or color

Additional notes

  • The printer is a HP Officejet 6500 E710n-z
  • Driver on Linux - HP Officejet 6500 e710n-z, hpcups 3.20.3 (color, 2-sided printing)
  • Driver on macOS 10.15.7 - 4.2.2

Suggested severity

  • S2
Type: task → defect
Has Regression Range: --- → no
Has STR: --- → yes

I can poke, thank you.

Flags: needinfo?(emilio)
Flags: needinfo?(emilio) → needinfo?(catalin.sasca)
Severity: -- → S3
Priority: -- → P1

Tried with both builds and the pages are still printed color on macOS 10.15.7 (via wireless printing).

Took a check on Windows 10 too, and it seems that it is not affected by this issue. The page was printed black and white.

Flags: needinfo?(catalin.sasca)

Just gave this a shot on my macOS (10.15.7) laptop, printing to a Canon iX6820 via direct cable.

Mozregression led me to this range, which includes Bug 1670943: Black and White printing support for macOS.

Prior to that patch, the drop-down to select color/monochrome is grayed out for macOS, so I couldn't confirm whether the monochrome print ever worked with my printer from the print UI before then.

Feel free to ping me if you need me to test a patch on macOS.

Two questions:

  • Does your printer have a monochrome option at all in the system dialog?
  • Does printing monochrome work on Chrome?

If the former is true I want some cups logs of a monochrome job and a color job, but we can figure that out via Matrix or what not.

Flags: needinfo?(enordin)

Those are good questions.

Re: Does your printer have a monochrome option at all in the system dialog?

It actually does not. Using mozregression to check a time before the print project started, it didn't then, either.

Re: Does printing monochrome work on Chrome?

Chrome also does not allow me to choose monochrome for my printer.


Digging in a bit more, it looks like my particular printer doesn't have a setting to use only black ink. Instead, it mixes other inks when it needs to print in grayscale.

https://community.usa.canon.com/t5/Professional-Photo-Printers/How-to-make-iX6820-to-print-grayscale-using-only-black-ink/td-p/284821

So I wonder if our issue here is that we're somehow not getting the correct SupportsMonochrome() value from printers.

I'm also not sure what this means for the terminology Grayscale vs. Monochrome. It seems like perhaps Monochrome means to instruct your printer to only use black ink, where as Grayscale means to submit a print job that has no color?

I wonder if we could provide more options in the future, for printers like mine, by editing the source content to be grayscale and submitting that, even if it's technically a full-color print job.

Flags: needinfo?(enordin)

Yeah, does it support grayscale? If so, could you attach the ppd file for the printer somewhere?

Flags: needinfo?(enordin)
Attached file PPD file for Canon iX6820 (deleted) —

Yes, according to the manual, it supports grayscale.

I'm attaching the PPD file. I had to compress it because it was too large to be a raw attachment.

Flags: needinfo?(enordin)

Ok, does adding an entry to this with "CNIJGrayScale", "1" cause it to be grayscale? If it doesn't, try "ON" instead of "1"?

Sorry for the ping-pong, driver-specific issues really suck :-/

Flags: needinfo?(enordin)

You're fine.

This worked for me with "1": It correctly printed in black and white. I tried in color after that, and that worked as expected, too.

I didn't try with "ON" since "1" worked.

Flags: needinfo?(enordin)

Ok, wanna send that patch in a separate bug, with a /* Canon */ comment of sorts? :-)

In terms of this bug... Catalin, any chance you could get the particular ppd file you're using? I clearly didn't find the right driver when searching for the comment 0 ones.

Thanks

Flags: needinfo?(catalin.sasca)

Yep, I'll submit a patch ASAP.

Depends on: 1676518

Catalin, if it saves you any time, the PPD files on my Mac were located in

/Library/Printers/PPDs/Contents/Resources/

with the individual files inside a bunch of .gz archives.

Attached file Resources.zip (deleted) —

Here is the folder "Resources" from the path Erik gave me. Hope this helps.

Flags: needinfo?(catalin.sasca)

Hmm, I don't see any gzipped ppd there unfortunately :(

Maybe you can zip up the whole PPDs directory? Or maybe the .gz files are somewhere else or are skipped while compressing the rest of the directory?

Flags: needinfo?(catalin.sasca)
Attached file Officejet 6500 E710n-z.zip (obsolete) (deleted) —

Emilio, here's the whole printer folder from library, maybe they are somewhere else, indeed :(

Flags: needinfo?(catalin.sasca)
Attached file Contents.zip (deleted) —

This is the correct one, it seems that I compressed the application instead of opening it first.

Attachment #9187165 - Attachment is obsolete: true

Catalin, I also have some other PPD files in

/private/etc/cups/ppd/

Maybe that's where yours are stored?

Flags: needinfo?(catalin.sasca)
Attached file Officejet_6500_E710n_z.ppd (deleted) —

Yup Erik, you were right, here's the actual PPD for the printer.

Flags: needinfo?(catalin.sasca)

Thanks Catalin!

So, hmm, given this:

*OrderDependency: 10 AnySetup *ColorModel
*DefaultColorModel: RGB
*ColorModel Gray/Grayscale: "<</cupsColorSpace 18/cupsBitsPerColor 8/cupsColorOrder 0/cupsCompression 0>>setpagedevice"                                                                                                                       
*ColorModel RGB/Color: "<</cupsColorSpace 19/cupsBitsPerColor 8/cupsColorOrder 0/cupsCompression 0>>setpagedevice"
*CloseUI: *ColorModel

I would've expected this line to take care of it...

Catalin, curious, does monochrome printing work from Chrome with the same printer?

Flags: needinfo?(catalin.sasca)
Summary: Page is printed with colors even if "Black and white" mode is selected from print preview → [CUPS] Page is printed with colors even if "Black and white" mode is selected from print preview
Attached video Chrome settings.webm (deleted) —

Hey Emilio, sorry for the late response. Tried on Ubuntu 20.04 but I cannot find the color settings in Chrome. Any idea?

Flags: needinfo?(catalin.sasca)

It seems chrome is not detecting monochrome printing either, otherwise you should see it above the "More settings" menu.

Ok, so Windows 10 is not affected at all by the monochrome setting, and it prints black and white if selected on every browser.

While on Windows 7, while plugged with USB, Firefox will still print color if b&w is selected, Internet Explorer 11 uses system settings and I couldn't find anywhere monochrome settings (windows 10 has the setting in IE11), and Edge (87.0.664.47) will print b&w if selected.

Tried Safari 14.0.1 but no luck in finding monochrome print (closest is Color Matching which has ColorSync and Vendor Matching settings, which are not related to monochrome).

Same driver, HP Officejet 6500 E710n-z

Whiteboard: [print2020_v84] [old-ui?] → [print2020_v85] [old-ui?]
Summary: [CUPS] Page is printed with colors even if "Black and white" mode is selected from print preview → [CUPS] In some printers, page is printed with colors even if "Black and white" mode is selected from print preview

This bug happens to me with Nightly 86.0a1 (2020-12-31) on Linux (Ubuntu 18.04) with a HP Deskjet 1055.

This printer has always supported grayscale printing, and it still works in Firefox when I use the system dialog and select "High quality grayscale". The bug is only when selecting "Black and white" from the new Firefox print screen.

Let me know if I can provide any assistance with this.

Can you attach the ppd of your printer driver Will?

Attached file Deskjet-1050-J410-series.ppd (deleted) —

Here it is

So we're passing ColorModel=Gray here, but your printer recognizes ColorModel=CMYGray and ColorModel=KGray instead :/

If you go to about:config, and change print.cups.monochrome.extra_settings to be ColorModel:CMYGray, does printing in monochrome start working?

Yep, that works!

I guess that ColorModel:CMYGray is what the system dialog calls "High quality grayscale" and ColorModel=KGray (which looks worse) is "Black only grayscale".

Yeah, that's exactly right. So for that printer we need to somehow detect which ColorModel does the printer support, and use CMYGray instead of Gray, I suspect, since gtk stores the settings in a hash table (so we can't really give it more than one value for an option).

That's a bit annoying, as we wanted to avoid parsing the PPD when detecting print settings because doing so kinda sucks, and because the APIs to do that are deprecated in CUPS... :/

Whiteboard: [print2020_v85] [old-ui?] → [print2020_v87] [old-ui?]
Attached file Xerox WorkCentre 7830.gz (deleted) —

PPD file for Xerox WorkCentre 7830. As requested here: https://support.mozilla.org/en-US/questions/1325194#answer-1392414

(In reply to h0nd from comment #30)

PPD file for Xerox WorkCentre 7830. As requested here: https://support.mozilla.org/en-US/questions/1325194#answer-1392414

Great! If you go to about:config, and tweak the print.cups.monochrome.extra_settings to say XROutputColor:PrintAsGrayscale, does it start working?

Dear Emilio, the print looks all nice in greyscales now. What an incredible support you are providing here.
Thank you!

Great, I filed bug 1693395 for doing this by default in future versions of Firefox :)

I guess grayscale printing is fixed for everyone here now? Let us know if that's not the case.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Attached file hpdj_3510.gpd (deleted) —

I'm having the same issue with HP Deskjet 3510 series on Windows 10, Firefox build 94.0.1: I can choose the "Black and White" option but it prints in color. Tried changing print.cups.monochrome.extra_settings to ColorMode:CMYGray, ColorMode:24bpp_gray, HPGrayScale:1, and lastly to HPGrayScale:1, HPGrayScale:IDS_GRAYSCALE_HIGH_QUALITY, ColorMode:Monochrome as a desperate attempt, to no avail.

I attached the gpd file for reference. Is there a chance that I have the wrong gpd file, or does firefox not support gpd at all (but then how would the "Black and White" option be available)? The thing is, I only have the one printer installed and there seems to be no other gpd/ppd files in System32/DriverStore which could be related.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: