Print Settings with CUPS

Support knowledgebase (jsmeix_print-cups-options)
Applies to

SuSE Linux: Versions since 7.2

Symptom

You are in charge of the administration of a CUPS printing system and find it very difficult to keep track of the different queue settings. For example: This also applies for the default queue settings: For the default queue setting, there is additionally the environment variable PRINTER. If this environment variable is set to a value other than lp, this setting determines the default queue with highest priority. If PRINTER is set to lp, it is ignored by CUPS. For traditional printing systems, there is an entry in /etc/profile or in /etc/SuSEconfig/profile, which normally sets PRINTER to lp. As this would determine the default queue with highest priority, it would be impossible to set any other default queue with the usual CUPS tools.

Furthermore, it is not possible to transfer the default queue on the CUPS server to the client machines because there could be several CUPS servers that broadcast several default queues to the client machines. For this reason, each client machine must have its own default queue setting. If there is no queue set to be the default queue, the first queue in alphabetical order is used by default.

Cause

The cause is not a bug, but a basic feature of CUPS:

Solution

The solution is simply to know where the settings can be stored and which settings are applied in what situation.

From SuSE Linux 8.1 on, the basic information can be found in the Administration Manual, Chapter "Printer Operation", Section "Command Line Tools for the CUPS Printing System", Subsection "Managing Local Queues".

Example:

For clarification purposes, we have chosen an example of a correct situation that becomes more and more confusing. To keep this example as concise and clear as possible, only command line instructions are used. However, it would make no difference if graphical tools like Kprinter and XPP or the CUPS web front-end were used instead.

Initial state:

Now the options will be changed in the following order:

  1. "root" executes the following command on "sun":
    lpadmin -p mono -o Resolution=150dpi
    to change the default resolution value to 150 dpi in the PPD file /etc/cups/ppd/mono.ppd
    *DefaultColors: Gray
    *Colors Gray ...
    *Colors Color ...
    ...
    *DefaultInkCartridge: Black
    *InkCartridge Black
    *InkCartridge Color
    ...
    *DefaultResolution: 150dpi
    *Resolution 150dpi ...
    *Resolution 300dpi ...
    *Resolution 600dpi ...
    
    Thus, the queue "mono" prints in grayscale with a 150 dpi resolution for all users on all machines.

  2. Then "root" executes the following command on "sun":
    lpoptions -p mono -o Resolution=300dpi
    to set the default resolution value to 300 dpi only for the machine "sun" in its file /etc/cups/lpoptions:
    Dest mono Resolution=300dpi
    
    Thus, "mono" prints in grayscale with a 300 dpi resolution for all the users on "sun" and in grayscale with a 150 dpi resolution for all users on "earth" and "moon".

  3. Now "root" executes the following command on "earth":
    lpoptions -p mono -o Resolution=600dpi
    to set the default resolution value to 600 dpi only for the machine "earth" in its file /etc/cups/lpoptions
    Dest mono Resolution=600dpi
    
    Thus, "mono" prints in grayscale with a 600 dpi resolution for all the users on "earth", in grayscale with a 300 dpi resolution for all the users on "sun", and in grayscale with a 150 dpi resolution for all the users on "moon".

  4. The normal user "tux" executes the following command on "earth":
    lpoptions -p mono -o Resolution=300dpi
    to set his default resolution value as 300dpi in his home directory in the file ~/.lpoptions:
    Dest mono Resolution=300dpi
    
    Thus, "mono" prints in grayscale with a 300 dpi resolution for the user "tux" on "earth" and in grayscale with a 600 dpi resolution for the rest of users on "earth". The settings on "sun" and "moon" remain unchanged.

  5. The user "geeko" executes on "earth" the command
    lpoptions -p mono -o Colors=Color
    to change his settings for the queue "mono". The new settings for the user "geeko" will be saved in the file ~/.lpoptions in his home directory:
    Dest mono Colors=Color
    
    Geeko's settings for the queue "mono" on "earth" make no sense, because two contradictory values are used: Colors=Color and InkCartridge=Black.

  6. "geeko" executes the following command on "earth":
    lpoptions -p color -o Resolution=600dpi
    to set his options for the queue "color" as follows. The new settings will be saved in his file ~/.lpoptions:
    Dest color Resolution=600dpi
    Dest mono Colors=Color
    
    The settings of the queue "color" for "geeko" on "earth" are wrong, because the only deployed value is Resolution=600dpi, which does not work for this printer (see above). This results in the queue "color" no longer working for "geeko" on "earth".

  7. "geeko" executes the following command on "earth":
    lpoptions -p color -o Resolution=1200dpi -o Foo=Bar
    to set his options for the queue "color" as follows. The new settings will be saved in his file ~/.lpoptions:
    Dest color Resolution=1200dpi Foo=Bar
    Dest mono Colors=Color
    
    It is possible to set values like Resolution=1200dpi and options like Foo=Bar, even though they are not considered in the PPD file. When printing, however, the default value from the PPD file (Resolution=300dpi) will be used and the option (Foo=Bar) will be ignored. Thus, the queue "color" works again for "geeko" on "earth", but the set values are totally unsuitable.

  8. When "root" deletes the queue "mono" on "sun" with the command
    lpadmin -x mono
    the now invalid entries in the files lpoptions mentioned above are not deleted, but remain unchanged.

  9. "root" creates again the queue "mono" on "sun", but a different PPD file is used:
    *DefaultColours: Gray
    *Colours Gray ...
    *Colours Color ...
    ...
    *DefaultResolution: 300x300dpi
    *Resolution 300x300dpi ...
    *Resolution 600x600dpi ...
    
    None of the previous entries in the files lpoptions are valid for the new queue "mono", since either the option names no longer match (Colours instead of Colors) so the option is ignored or the option values no longer match (300x300dpi and 600x600dpi instead of 150dpi, 300dpi, and 600dpi) so the default value from the PPD file is used.

General Rules for Setting Definitions:

The command
lpoptions -p "queue" -l
displays the possible settings. The values that, according to the rules above, will be used for a print job are marked with a preceding *.

According to this, the user "geeko" on "earth" might have used the following command in item 7
lpoptions -p color -l
to verify which settings would be used for his print job via the queue "color". He would have seen that these do not correspond to the settings in his file ~/.lpoptions, because the output would be

Colors: Gray *Color
InkCartridge: Black *Color
Resolution: 150dpi *300dpi 600dpi

Suggestion for Keeping an Overview:


See also:
o Printer Configuration with SuSE Linux 8.1
o Print Settings for ASCII Texts with CUPS

Keywords: PRINT, PRINTER, CUPS, SETTINGS, OPTIONS

Categories: Frequently asked Questions , Documentation , Printer

Feedback welcome: Send Mail to jsmeix@suse.de (Please give the following subject: SDB-jsmeix_print-cups-options)
SDB-jsmeix_print-cups-options, Copyright SuSE Linux AG, Nürnberg, Germany - Version: 28. Nov 2002
SuSE Linux AG - Last generated: 28. Jul 2003 by ip (sdb_gen 1.40.0)