Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 5003  / 3 Years ago, thu, september 23, 2021, 7:40:25

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!



More From » 12.04

 Answers
3

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.


[#29675] Friday, September 24, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
teromato

Total Points: 139
Total Questions: 102
Total Answers: 100

Location: Liechtenstein
Member since Mon, May 15, 2023
1 Year ago
;