cancel
Showing results for 
Search instead for 
Did you mean: 

CUPS printer options

Stefan_6
Frequent Advisor

CUPS printer options

Hi everyone!

Got some kind of trouble with our CUPS on SuSE 7.3!

I want to set up "aliases" for the most frequently used printer options (e. g. landscape, cpi=xx, and so on) because its impossible to explain to some 2000 Users how to exactly format a print job. In words: instead of "lp -dprinter -o landscape -o cpi=5 file" it has been standard over years to set the following command: "lp -dprinter -olp -oc file";
Does anybody knows where I can define these aliases?

Thx
4 REPLIES
Martin Burnett_2
Trusted Contributor

Re: CUPS printer options

Hello Stefan

I found this information in the CUPS User Manual (http://www.cups.org/sum.pdf)

The lpoptions(1) command saves the options for your printers. Like the lp and lpr commands, it accepts printer options using the -o argument:
lpoptions -o media=A4 -o sides=two-sided-long-edge ENTER

lpoptions -o media=Legal -o scaling=100 ENTER

Once saved, any lp or lpr command will use them when you print.

The lpoptions command can also be used to show the current options by not specifying any new options on the command line:
lpoptions ENTER
media=A4 sides=two-sided-long-edge
lpoptions -p deskjet ENTER
media=Legal scaling=100

Besides setting options for each print queue, CUPS supports printer instances which allow you to define several different sets of options for each printer. You specify a printer instance using the slash (/) character:

lpoptions -p laserjet/duplex -o sides=two-sided-long-edge ENTER

lpoptions -p laserjet/legal -o media=Legal ENTER

The lp and lpr commands also understand this notation:
lp -d laserjet/duplex filename ENTER
lpr -P laserjet/legal filename ENTER

HTH
Martin
Stefan_6
Frequent Advisor

Re: CUPS printer options

Yo Martin!

Thanx for your reply!

Sure I've also digged the cups.org Docs and of course found this pdf; the problem of the "lpoptions" command is, that I define DEFAULTS, in words the printer ALWAYS prints in landscape mode if I configure lpoptions; unfortunately it has to remain flexible we must be able to print landscape or not, compressed or not, etc.

greets
Stefan
Martin Burnett_2
Trusted Contributor

Re: CUPS printer options

Hello Stefan,

This is why you need to use the -p option to specify "instances".

lpoptions -p printer/alias1 -o media=A4 -o cpi=5

lpoptions -p printer/alias2 -o media=legal

Then when you run your print job you use the following:

To print a A4 document:
lp -d printer/alias1 file

To print a Legal document:
lp -d printer/alias2 file

This keeps your flexibility. The users would just have to know which alias to use for the documents they use the most. Perhaps you could even publish a cheat-sheet stating which printer/alias to use for the document.

HTH

Martin
Stefan_6
Frequent Advisor

Re: CUPS printer options

Okay, now I understand the function "lpoptions" (therefore the assigned Points :) ); this means that I create a "virtual" printer for the printer xxx with the option e. g. landscape=true;

AND now I know that its useless for us, 'cause it would mean that I have to create for each of our some hundred printers at least 8 or 9 instances, need to update thousands of print commands in our databases and not to mention "some" of user specified SQL-Statements :) !

I think I have to take it as it is and manipulate the source files :(

After all, thanks a lot for your help!