2

Forgive me if this has been answered already. Please point me to the relevant post.

I am trying to use lpoptions to set the default print mode to B/W. Works fine when I use the web interface but lpoptions doesn't seem to have any effect.

My printer is a networked HP LaserJet (and is the system default) and when I do (as root)

lpoptions -l

I get a list that includes

PrintoutMode/Printout Mode: Draft Draft.Gray *Normal Normal.Gray High High.Gray
Quality/Resolution, Quality, Ink Type, Media Type: *FromPrintoutMode 150BestColorCMYK 150ColorCMYK 150DraftColorCMYK 150DraftGrayscaleK 150GrayscaleK 300BestColorCMYK 300ColorCMYK 300GrayscaleK 600BestColorCMYK 600GrayscaleK

So I expect that when I do

lpoptions -o PrintoutMode=Draft.Gray

the default colour mode should be "Draft Gray". (Yes, I have restarted the CUPS service too, in case that mattered.) Yet, when I open an application and do File->Print and check the options it still says "Color".

When I make the same change through the web interface I see the change immediately. What am I missing? Please.

2

Get to the CUPS interface, it will show the installed printers. To change the defaults go to "Set Printer Options" and select the option you what to change, colormode = Black and White.

Otherwise, since you said your client needs to have a command line queue to do it, you could do so: lpadmin -p {printer name} -o {ppd property} from the console.

You can get the name which CUPS is using for the printer with a simple lpstat -p.

The property you'll want to set is EFColorMode to Grayscale. So a sudo lpadmin -p {printer name} -o EFColorMode=Grayscale may be enough.

  • Thanks, Jeff, but my question was how to do it using command line. I already know how, and can, do it with the Web interface. :) – Colin Wu Jan 21 '17 at 21:31
  • @ColinWu is there a good, valid reason to do it from command line? What changes? – JeffWalterz Jan 21 '17 at 21:32
  • The client I'm working with wants to. :( Good enough? Having said that, a valid answer could be "it can't be done" ; however, all the documentation and Stackexchange posts I've looked at so far seem to say this is totally doable. I just haven't found the right cat to twirl yet. – Colin Wu Jan 21 '17 at 21:36
  • @ColinWu you could try to queue your printer so: lpadmin -p {printer name} -o {ppd}, the PPD property you'll want to set is EFColorMode, so EFColorMode=Grayscale. sudo lpadmin -p {printer name} -o EFColorMode=Grayscale. With lpstat -p you can find the name which CUPS is using for the printer. – JeffWalterz Jan 21 '17 at 21:39
  • 2
    SOLVED: The problem is that lpoptions changes are only seen by command-line print programs like lp and lpr. In order for GUI programs to see the change one must use lpadmin to make changes directly to the ppd file. Thanks @JeffWalterz. – Colin Wu Jan 23 '17 at 15:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.