The Basics
There are numerous printers located throughout the department. The printers are named after trees (a subtle hint that you are consuming paper and hence trees when printing).
Printing will be done on your `default printer' which is automatically set when you login to be the nearest black and white printer.
Graphical Print Tools
Graphical applications will typically have a built in print option. This may bring up a simple dialog where you can modify the print command which by default is likely to be lpr or it may be a fully featured tool that queries the printer configuration and allows you to select printers and print options from various drop down menus.
There are also general graphical print tools such as gtklp
and xpp
. These tools can also be useful if you wish to browse the list of available printers.
Linux Printing commands
You will typically print from within applications but there are command line tools too:
lpr
This is the basic command to pass a file to the print server for a specific printer.
lpr -Pprinter filename
Note that there is no space between the -P and the printer name.
To print the file data.ps on the printer pinetree type
lpr -P pinetree data.ps
Note provided your PRINTER is set there is no need to include the -P option.
enscript
This is used to print ordinary text files. To produce two pages of plain text next to each other, type
enscript -Pprinter -2Gr filename.
-->
dvips
This is used for printing out a DVI file (a file produced after processing a TeX file). It is invoked using
dvips -Pprinter filename.dvi
To specify the first page to print from use the -p option and for the last page the -l option, e.g.
dvips -Pprinter -p 5 -l 10 filename.dvi
to print pages 5 to 10 inclusive.
It can also be used for converting the DVI file to a POSTSCRIPT file by using
dvips filename.dvi -o filename.ps
Duplex (Double-sided) printing
Most public printers have duplex units fitted which enables them to print double-sided. Where possible the default print queue is always set to the duplex queue.
If you are printing a landscape document then the default duplex tumble will mean the backs are upside down.
To rectify this you can add an option to the print command as follows:
lpr -o sides=two-sided-short-edge myfile.ps
which changes the duplex tumble from the long edge to the short edge.
Single sided printing
If your default printer prints doubled sided and you wish to print a document in single sided mode then use
lpr -o sides=one-sided myfile.ps
N-up printing
Sometimes you may want to print more than one original document page per single side of paper. You can do this with an extra print option:
lpr -o number-up=2 myfile.ps
which puts 2 original pages to each side of paper. The number up option supports 2, 4, 6, 9 and 16 to a side.
In the case of 2 up you may also want to use the two-sided-short-edge option as explained above to get the backs the right way up.
Transparency printing
When printing transparencies first make sure you have the right type as the wrong ones can cause several hundred pounds worth of damage. Transparency types:
- Colour laser printer transparencies - only use in colour laser printers
- Black and white laser printer transparencies - only use in b/w laser printers
- Photocopier transparencies - never use in a printer!
- Write on transparencies - never use in printers or photocopiers!
To print on a transparency first put the required number in the paper tray or load them into the pull down tray 1. Now send the required pages to the printer with a command of the form
lpr -P printer_name -o sides=one-sided -o media=Transparency filename
where you need to specify the printer_name, e.g. lpt14-colour, lpd28-colour. Also remember to use a page range option if appropriate.
Other option to lpr that may be useful
- -o landscape
- -o page-ranges=1-4,7,9-12
- -o page-set=odd
- -o page-set=even
- -o outputorder=reverse
- -o prettyprint
- -o scaling=90 (scale to 90% the size of the page)
Note: Some graphical print applications may write settings to a file ~/.lpoptions
which will override some command line options. A common symptom of this is the failure of the sides option to have any effect. To `fix' the problem remove the .lpoptions file and retry.
Checking the print queue
The printing system is a distributed system with printers being controlled by print servers.
Network printer
Printing goes via a network print service. Using the lpq command will only report the queue on the local machine which will generally be empty since it will have handed the job off to the print server.
To check a remote queue on a given machine you can use the lpstat command. The network printer queues are hosted by the machines print0.
To check the queue for printer pinetree on server print1 you would run the command
lpstat -h print0 -o pinetree
To remove a job from a remote queue, say pinetree on print1, you can use the cancel command, e.g.
cancel -h print0 -u <username> pinetree-<job-number>
where you need to replace <username> and <job-number> by the username and the job number as given by the output of lpstat. For example if the output of lpstat for print1 looks like
pinetree-5706 smith 1024 Wed 05 Apr 2006 07:59:14 BST
then the job is on printer lpd28 with job number 5706 and the username is smith so you run the corresponding cancel command would be
cancel -h print0 -u smith pinetree-5701