http://www.mandrakeuser.org/docs/hardware/hcups7.html

MandrakeUser.Org - Your Mandrake-Linux Knowledge Base!

 
 

*DocIndex - Hardware

Printing With CUPS

Printing I

* Printing
* XPP
* QtCUPS
* Command line tools

Related Resources:

See Resources on article index

Modified: Nov 20, 2000
Author: Till Kamppeter

 

* Printing

For printing with CUPS there are two comfortable graphical tools available: xpp and qtcups, but one might also use the command line, the syntax is compatible to that of the old LPD.
CUPS understands a lot of file formats: PostScript, PDF, HP-GL/2, plain text (also with accents and diacritical marks as used in French, German, Portuguese, etc.), and many image formats (JPEG etc.).

* article index * top

* XPP

xpp, the X Printing Panel, was the first free graphical printing tool for CUPS. It is designed to go easy on resources and to be independent of the desktop in use. Just run it instead of lp or lpr.
At the command line print a file or standard input with

xpp [file name]

or

[command] | xpp

where [file name] can be the name of any file in a format which is understood by CUPS and [command] any command with output in a format understood by CUPS. You can also enter the xpp command as the standard printing command in any application. 'xpp' is also available in the desktop menus: choose "Applications"/"Publishing"/"X Printing Panel"

When 'xpp' is started, a window presents a list of all available printers, a prompt line for the name of the file to print, and some additional buttons.
Choose the printer on which you want to print from the printer list and enter the names of the files to be printed on the prompt line (or leave it empty for printing from standard input). You can edit this prompt line or you can add file names using the "Browse" button. At the bottom of the window you can adjust the number of copies to print and the priority of the job. "Cancel" closes the window without printing and "Print" prints the file. The "Options" button opens the options dialog where you can set up many options to suit the printout to your needs.

In the "Options" dialog the options are dispensed on several tabs. The first three tabs are always the same, they show the printer-independent options provided by CUPS. Here you can choose which pages to print, toggle double-sided printing, 2 or 4 pages per page, adjust character size and margins for plain text printing, brightness, saturation, hue, gamma for images, and so on. Beginning from the fourth tab you will find printer-specific options, as paper trays, resolution, printout quality, and so on. The printer-specific options for PostScript printers are the same as under Windows or Mac Os. For other printers it depends on the configured driver which options can be found here. Some drivers offer even adjustment sliders for the colors or for the alignment of the printer heads.

You can save your preferred options with the "Save" button. With the "This printer as default" button you can set the currently chosen printer as your personal default printer.

If you run 'xpp' from your personal account, the options and default printer information is stored in the '.lpoptions' file in your home directory, so that the changes are only made for the current account. If 'xpp' is run by 'root', the default printer and option settings are stored in '/etc/cups/lpoptions', and thus apply to all users.

* article index * top

* QtCUPS

'QtCUPS' fulfills the same task as xpp, in that it is also a graphical tool for printing. You start it like xpp, just type qtcups instead of xpp".
In contrast to 'xpp', you can't set a default printer or enter a file name, but otherwise it provides quite the same functions. The difference lies in the user interface, which closely resembles similar tools in Microsoft Windows. In the "Properties" dialog you will find all the options you can set up for your printer, but in contrast to 'xpp' all the options have an icon which illustrates what the option does. The printer-independent options for brightness, saturation, and hue even have a sample image which shows the effects of these options.

When you are using KDE's 'Konqueror' you can print files with 'QtCUPS' simply by dragging them onto the printer icon on the desktop. 'QtCUPS' is assigned to this icon by default.

* article index * top

* Command line tools

CUPS' command line tools offer maximum compatibility to the old LPD system, allow printing from scripts and the console.
The most important command is lpr, which features exactly the same options and shows the same behavior as LPD's lpr command. So all applications which use the lpr command for printing will still print with CUPS. Using lpr without specifying a printer prints on the default printer, but you can choose the printer as with the former lpr" command:

lpr -P [printer] [file]

What's new with CUPS' lpr" command is that you can supply options with -o":

lpr -P [printer] -o page-ranges=1-4,7,9-12 -o media=Upper [file]

This command line prints only the pages 1-4, 7, and 9-12 and the paper is taken from the upper tray. You will find an overview of all printer-independent options in the CUPS Software Users Manual; for a listing of the printer-specific options, type:

lphelp [printer] | less

You can also save options as your personal defaults or set your default printer:

lpoptions -d [printer]

sets [printer] as your default printer and

lpoptions -p [printer] -o media=Upper -o number-up=2

sets two pages per sheet and paper from the upper tray as default options for [printer]. All further lpr, xpp, and QtCUPS calls will use these options as their default settings. To remove the -o number-up=2 option, enter

lpoptions -p [printer] -r number-up

and to remove all personal default options for [printer], use

lpoptions -x [printer]

If you are logged into your personal account, the options are stored in the '~/.lpoptions' file in your home directory. If you are logged in as 'root', the options are stored in '/etc/cups/lpoptions', the file for system-wide defaults.

For further information on these commands enter man lpr and man lpoptions", or read the CUPS Software Users Manual.

* article index * top

 
Legal: All texts on this site are covered by the GNU Free Documentation License. Standard disclaimers of warranty apply. Copyright LSTB (Tom Berger) and Mandrakesoft 1999-2002.