7

CUPS has always had a configurable set of "Default Options" for a print queue.

system-config-printer also enables editing these.

But applications (see below) seem to completely ignore these! I'm sure (I've been using Debian/Ubuntu for 10 years) they didn't use to ignore them.

Is there some issue somewhere? Or a configuration option I've got wrong somewhere? Or a fix/workaround?

I've noticed that if I create a new user, the defaults are there. So there must be a user setting somewhere - But where?!

Specifics

I know there's no point asking a question like this without specifics, so here you go:

  • applications which disrespect defaults: Firefox, DigiKam, EOG ("Image Viewer"), LibreOffice 3, Thunderbird, Evince ("Document Viewer"). I haven't found a single application that does respect the defaults.

  • Environment: Ubuntu 12.04 LTS with Gnome Shell.

  • Printer driver (stock, from Ubuntu): "HP Photosmart 7510 Series, hpcups 3.12.2"

  • A specific example is that the default options say: duplex, "best" quality, "plain paper", but the apps all default to non-duplex, "high resolution photo" quality, "photo paper". This means it takes 10 minues per sheet, and costs a fortune in ink!

5 Answers 5

6

Summary: you're probably seeing the options for the last instance in ~/.cups/lpoptions.


There are both system-wide defaults and per-user defaults.

The system-config-printer application and the CUPS web interface configure system-wide defaults. These are stored in /etc/cups/printers.conf and /etc/cups/ppd/NAME.ppd where NAME is the name of the printer. In a .ppd file, an option setting line looks like this:

*DefaultDuplex: DuplexNoTumble

The possible values for this option, which is called Duplex, are given by lines like

*Duplex None/Off: …
*Duplex DuplexNoTumble/Long-Edge Binding: …
*Duplex DuplexTumble/Short-Edge Binding: …

The part after the colon describes the commands to send to the printer to activate the setting. The part before the colon consists of a *, then the name of the option, then a space, then one or more names for the value separated by slashes (for example, “None” and “Off” mean the same thing for this particular option, you can use them interchangeably).

You can also have per-user defaults stored in a file called .cups/lpoptions in your home directory. The syntax of this file looks like this:

Dest lj/single Duplex=None
Default lj Duplex=DuplexNoTumble

A line like Dest lj/single … defines an instance called single of the printer called lj. When printing to that instance, the Duplex option is set to None. When printing to the default instance, the Duplex option is set to DuplexNoTumble (i.e. double-sided). The line Default lj … defines default options when printing to lj. These options override the system-wide defaults. The use of Default rather than Dest makes lj the default printing destination.

(You can also have a system-wide /etc/cups/lpoptions. Why have a system-wide file, which might seem redundant with the options set in the .ppd file? The difference is that if your computer acts as a print server from other computers, the .ppd file applies to all, whereas /etc/cups/lpoptions only applies when printing from the local computer.)

You can use instances to make different sets of options available under a nickname from the command line. For example, with the lpoptions file above, lp -d lj prints double-sided and lp -d lj/single prints single-sided. Instances are also visible in some GUIs, for example in the KDE print dialog.

The Gnome print dialog does not show different instances, you only get one. However, rather counter-intuitively, Gnome doesn't default to the options for plain lp, but instead picks the last instance that was mentioned in the lpoptions file. So for example, with the lpoptions file above, the default is duplex printing, but if the two lines were swapped, the default would be single-sided.

Another trap with Gnome is that it also reads the file ~/.lpoptions. This is an old location for ~/.cups/lpoptions, which the printing system doesn't read anymore since Ubuntu 12.04 or thereabouts, but which Gnome still reads as of Ubuntu 14.04. If you have one, rename it to .cups/lpoptions or delete it.

3

I found that many applications (for example, firefox, evince, gThumb) follow the settings in ~/.cups/lpoptions Use a text editor to update your favourite settings.

To list all available options use the command

lpoptions -l

To check the available duplex configuration for example use

lpoptions -l | grep -i duplex

shows:

Duplex/2-Sided Printing: None *DuplexNoTumble DuplexTumble

To check the available printing quality options

lpoptions -l | grep -i StpQuality

shows:

StpQuality/Print Quality: None Economy *Draft Standard High Photo HighPhoto UltraPhoto Best
2

Ah ha! I looked at the hidden files in my home dir and found one called .cups which contained an lpoptions file.

No idea how that got there, but deleting the folder makes my defaults work again.

Sanity restored!

4
  • Mmh, didn't work for me ("reverse" printing option, specifically). Tested with evince but to no avail. Settings are still not read from default configuration. Aug 31, 2013 at 10:14
  • Does it work if you create a brand new user account? Sep 2, 2013 at 8:08
  • I suppose that might work but I am not too keen on trying it out, honestly. I don't think switching over to a new user account would be worth it just to fix this issue. And who knows, it might even reoccur after a few weeks of usage. But thanks for the help, anyway! Sep 2, 2013 at 8:48
  • It only takes 5 mins to test it. I agree, I would not want to start anew either, but knowing that it was something user-specific helped me know where to look for the problem. Sep 2, 2013 at 8:58
1

Some applications "remember" the printer settings from previous print requests. So if you change system defaults AFTER you have already printed once with previous defaults, it "remembers" previous settings even if you don't want it to!

Eg. Evolution stores printer settings in ~/.evolution/printing, Evince in ~/.config/evince/print-settings

There doesn't seem to be a standard way (or apps just don't adhere to it) for apps to store this info.

I think, but haven't confirmed, that if you don't touch defaults when printing from the application, it won't save the settings, and therefore system defaults will continue to pass through. But, change a setting once, and the saved setting will always override the system default for that application.

This explains why new users pick up defaults fine. But existing users are seeing the problem.

0

My solution is not the best one for sure, but worked for evince for my porpouses.

cd ~/.config/evince
rm print-settings
chmod u-w .

Now evince cannot save its settings and changes are valid just while it's open. Stupid and limited solution, I know! But good enough for me for now. :)

Regards,

Jander

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .