$ lpr -P <printer name> -o <options> <document>
Additional options have to be appended with -o. There has to be an -o for every option. Options may vary for different printers. Some examples:
- Set margin: -o page-left=NN (left can be exchanged with right, top, bottom. "NN" is a placeholder for points (1 point = 0.35cm))
- Automatic line break: -o wrap=true
- Explicit use of a specific paper slot: -o InputSlot=Lower (it is in fact a little more complicated, because every printer comes with its own names for different slots)
Example: Printing a text file with around 1cm left margin and automatic line break
lpr -P compinet -o page-left=70 -o wrap=true datei.txt
It becomes cumbersome quite fast to use these options. If a lot of settings are to be made, it is advised to use a graphical lpr substitution like kprinter (see below).
Duplex-printing is done by special printer instances. Every printer "<printername>" comes with a second entry "<printername>-dup" which can be used to print duplex.
It is not required to set duplex printing in the options manually.
It can be useful sometimes, to create an instance for frequently used options. It is possible to create such instances using lpoptions. They are saved at ~/.lpoptions.
- Show options: lpoptions -p <printername> --- Lists all possible options of a printer in its default settings.
- Setting resolution (DPI): lpoptions -o ColorModel -o Resolution=600dpi -P <printername>
- Set instance: lpoptions -p printername/instancename -o Option1 -o Option2 ... -o OptionN --- Setting your own instance (old instances will be overwritten!!!).
- Show instance: lpoptions -p printername/instancename
- Delete instance: lpoptions -p printername/instancename -x
Jobs can be cancelled using the Linux command line.