| Computer Center

Linux Printing

Computer Center

Linux Printing

1. Printing with Cups Server ZNCUPS
2. Overview of Cups Printing Options on UNIX
3. Printing from Linux Notebooks
4. Frequently Asked Questions

1. Printing with Cups Server ZNCUPS

The Common Unix Printing System (CUPS) is the central printing system on all UNIX machines at DESY Zeuthen.

1.1 default printer: set LPDEST to your favorite printer


1.2 Printing with the CLI (command line interface)

1.3 Examining the print queue with the CLI

1.4 Cancelling of print jobs with the CLI

The CUPS job on the local system gets a job-id which is not suitable for removing a job on the print server. The job-id on the print server is different, it can be displayed using lpstat. After finding out the job-id on the print server you can remove it. Use cancel and no longer lprm for removing your print jobs.

[myhost] % lpstat -o

znrz1-31                  ottostr           1688576     Thu Jan  4 12:20:51 2007

znrz1-32                  frida            31596544     Thu Jan  4 12:20:55 2007

znrz1-33                  wwinzig           1654900     Thu Jan  4 12:30:57 2007

znrzc-34                  ottostr          61533324     Thu Jan  4 12:32:13 2007

[myhost] % cancel znrz1-31 znrzc-34

2. Overview of Cups Printing Options on UNIX

Printing Options are passed to Cups using the -o Option of lp and lpr:

disables duplex printing
lpr -o sides=one-sided testpage.ps
use printer/simplex if supported
enables duplex printing for landcape pages
lpr -o sides=two-sided-short-edge myfile.gif
enables duplex printing for portrait pages
lpr -o sides=two-sided-long-edge info.txt
not the complete document is printed, but only the specified pages
lpr -o page-ranges=1,3-5,7 textfile
only for ASCII-text
places multiple document pages on a single printed page
lpr -o number-up=4 project.pdf
supported are: 1, 2, 4, 6, 9, and 16
changes printers resolution
lpr -o Resolution=600dpi testpage.ps
lpoptions can be used to find out
supported Resoltions fo a queue:
lpoptions -p queuename -l |grep Resolution
prints on transparent Media
lpr -o media=Transparency talk.ps
use printer/transp if supported
prints on DIN A3 paper
lpr -o PageSize=A3 picture.gif
use printer/A3 if supported
The scaling value is a number from 1 to 800 specifying the size in relation to the page (not the image).
lpr -o scaling=100 pict.gif
can be used for image formats
rotate the page 90 degrees to print in landscape orientation
lpr -o landscape picture.jpg
rotates the page depending on the value of N
lpr -o orientation-requested=4 file.ps
possible values:
3: no rotation,
4: 90 degrees,
5: 270 degrees,
6: 180 degrees
do not print bannerpages
lpr -o job-sheets=none file.ps
scale font to NUMBER characters per inch
lpr -o cpi=9 textfile
only for ASCII-text
scale font to NUMBER characters per inch
lpr -o lpi=9 textfile
only for ASCII-text, this overwrites the cpi-option

For more options and additional information see the "Cups Commandline and Options Manual".

3. Printing from Linux Notebooks

3.1 using cups

Use one of the following two methods to let your local cups communicate with our server. Afterwards you can use cups as described above.

3.1.1 use a global cups-daemon

3.1.2 bypassing the local cups configuration

passing the servername to the client

CUPS_SERVER=zncups.zeuthen.desy.de # zsh
lpstat -a # to see all printers
lp -d <printer> ...

lpstat -h zncups.zeuthen.desy.de -a # to see all printers
lp -h zncups.zeuthen.desy.de -d <printer> ...

3.1.3 permanent configuration without local cups-daemon

If you have no local cupsd running, just change the Servername directive in /etc/cups/client.conf to zncups.zeuthen.desy.de

3.2 lpr/lp based printing system

If you work with a lpr/lp based subsystem a printcap entry in your /etc/printcap file would probably look like this:

4. Frequently Asked Questions

Please read the FAQs here.