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

MandrakeUser.Org - Your Mandrake-Linux Knowledge Base!

 
 

*DocIndex - Hardware - Article Index

Printing With CUPS

Setup And Configuration I

* Printerdrake
* KUPS
* WWW Interface
* lpadmin
* Installing Postscript Printers
* Configuring The CUPS Daemon

Related Resources:

See Resources on article index

Modified: Nov. 13, 2000
Author: Till Kamppeter

 

The administration of printers is much easier now. You can either control your printers from the command line with the lpadmin program and by editing the configuration files in the '/etc/cups/' directory, or by the graphical tools 'PrinterDrake' and 'Kups', or by the web interface of CUPS (Go to http://localhost:631/ with any web browser).
There are also special tools like kupsdconf for configuring the CUPS daemon, tools for color calibration, cartridge changing on win printers, nozzle cleaning, and so on ...

An additional hint for all configuration programs: If they ask you for login and password, you normally have to log in as 'root'. As long as you don't change the access permissions of the CUPS daemon in '/etc/cups/cupsd.conf', that is.

Note: When you have added a new printer, you should always check its default options. Set the correct paper size and select a higher output quality/resolution when the initial one is poor. For text printing set the margins so that nothing of the text gets cut off. Do a color calibration when possible. Most bad quality printouts are a result of poor default settings.

Note: All what is shown here works in all the security levels up to "medium" without any changes to the system's configuration. If you want to use CUPS in the "high" or "paranoid" security mode, read the "Security Level" section.

* article index * top

* PrinterDrake

'PrinterDrake' is Mandrake's default configuration tool for CUPS. It is first started during the installation of Linux Mandrake 7.2 when you are configuring your printer(s). You can also call it when your system is installed by clicking on the printer icon in "DrakConf" or by typing /usr/sbin/printerdrake & at the command line. If you are not in X, you will get a text mode interface.

The operation of the program is rather intuitive, you simply follow the instructions given on the screen. When you choose one of the existing queues for modifying or deleting, you always have to choose the printer's connection type ("Local"/"Remote"/"Windows"), even if you do not want to change it or if you want to delete the queue. On the next screen the printer's name must be entered, location and description are optional. They are displayed by all graphical printing or administration front ends and also by the web interface and help users to find the most suitable printer for their needs.

If more than one printer is detected on your machine, you are asked which printer should be assigned to the queue name you have entered. Then, you get a list of all available printer drivers. The driver suitable for your printer will be highlighted.
For many printers there is more than one choice. The best choice are usually the GIMP-Print drivers: the "CUPS + GIMP-print v4.0" drivers allow a comfortable color calibration, and the "Foomatic + stp-4.0 (GIMP-Print)" drivers have more adjustment possibilities.
"Foomatic" means that this PPD file is generated by linuxprinting.org, the second part refers to the Ghost Script driver. "CUPS + GIMP-Print" means that the driver is based on the filters provided with CUPS and on the special CUPS drivers of GIMP-Print. You should consult linuxprinting.org/printer_list.cgi, to see which driver is recommended for which printing task on your printer. Do not hesitate to set up more than one queue for one printer to be able to choose between different drivers.

If the printed test page is of poor quality or at a wrong paper size, you usually should accept this driver anyhow.
Many drivers (especially GIMP-Print) are preconfigured poorly and thus the test pages of a rather bad quality. Unfortunately, 'PrinterDrake' has no possibility to change the default options. You should run 'Kups' or the WWW administration tool afterward to fine tune the options.
When you answer "No", you get back to the model menu to try another driver.

* article index * top

* KUPS

The most sophisticated printer administration program for CUPS is the KDE-based 'Kups' (Menu: "Configuration"/"Printing"/"Kups", command line: kups &). You do not need to have KDE running as your desktop environment, it suffices that KDE is installed on your system (this is even the case in the 300 MB minimum installation).

'Kups' shows a list of all printers and classes in a tree on the left and the properties or the jobs of the chosen printer on the right. To change one of the displayed printers, classes or jobs, you simply click on the appropriate object with the right mouse button. You will get a menu with the things you can do with this object.
The most important thing here are the "Configure Printer" and "Test Printer" options in the printer menus. They let you change the default options (like resolution, color/gray scale, paper size, and so on) and print a test page, so you can optimize the defaults for your typical printing tasks. For changing the printer's name, driver, or description, use the "Properties" button in the lower right corner of the main window (only when the "Infos" view and a local printer is selected).

For adding a printer or class there is a very sophisticated wizard: you simply choose "Printer" and then "Add" in the menus of CUPS and the wizard starts. It auto-detects local printers (parallel, serial, USB) and when you install an SMB (printer on server running Windows) or a Socket (printer connected by Ethernet) printer, the wizard scans the local network to search for available printers of this type. Just press the "Scan" button on the appropriate screen of the wizard. Afterward you simply click on the desired Socket printer or you choose the SMB server in the workgroup tree and double-click it, and then choose the desired printer.

In the model/driver selection you can look at the available options with the "Show Options" button before you choose the driver for your printer. The options dialog also shows the driver type (for example "CUPS + GIMP-Print"). If there is more than one driver for a model entry, you get a little menu to choose the driver from. Note that for some driver entries the model name is preceded by the manufacturer's name whereas for others not, so check both locations in the list (especially when you search for the "CUPS + GIMP-Print" drivers).

To configure a remote CUPS server, choose "File" and then "options" in the menu and replace the "localhost" in the "CUPS host" field with the name of the server.

If you have started 'Kups' as 'root', you can also configure the CUPS daemon by choosing "File" and then "Configure CUPS daemon" in the menu.

* article index * top

* WWW Interface

The WWW interface of CUPS can either be invoked by "Configuration"/"Printing"/"CUPS WWW admin tool" or by pointing your browser at http://localhost:631/ (local CUPS daemon) or to http://<server name>:631/ for a remote CUPS server. The WWW interface does not have as much functionality as 'Kups', but you can also use it from clients running a different operating system than Linux. It is even possible to use it in text mode with console browsers like 'Lynx', 'links', or 'w3m'. See the CUPS Software Administrators Manual for details on how to use it.

Notice: when you have changed something and you go back to a previous page using the "Back" function of your browser, you have to reload the page to make your changes visible.

* article index * top

* lpadmin

To add, remove and configure printer and class queues from the command line or from scripts ('PrinterDrake' is such a script) use lpadmin.
Here are some examples:

To add a queue named "deskjet" for an HP DeskJet 840C on the USB enter:

lpadmin -p deskjet -E -v usb:/dev/usb/lp0 \
-m HP/DeskJet_840C-stp.ppd

To change the driver for the "deskjet" queue and add some information, enter:

lpadmin -p deskjet -m HP/gimp-print/pcl-840.ppd \
-D 'New driver!'

You get information about the available PPD files with

poll_ppd_base

If you have one of these nice HP LaserJet 4050N Postscript printers connected via Ethernet, copy its PPD file from the CD which came with the printer to the /tmp directory, and do

lpadmin -p lp -E -v socket://192.168.1.100:9100/ \
-P /tmp/lj4050.ppd

to access this printer via the "lp" queue (we assume that the IP of the printer is 192.168.1.100 and the port is 9100).

After you have found out how nice it is to work with the HP LaserJet 4050N, you give the good old LaserJet 1100 to your mother-in-law. Now you want to get rid of the queue for it on your machine. Simply enter

lpadmin -x laserjet

This nice LaserJet 4050N should be the default, no problem:

lpadmin -d lp

Interested? The man page has more:

man lpadmin

Or read the CUPS Software Administrators Manual.

* article index * top

* Installing Postscript Printers

All Postscript printers (with hardware Postscript interpreters) are perfectly supported by CUPS and thus by Linux Mandrake 7.2.
You only need the PPD file of your printer supplied by the printer's manufacturer. You find this file either on the CDs or floppy disks that came with the printer (as part of the Windows/Mac OS drivers), or you can download it from the web site of the printer's manufacturer or from the web site of Adobe.

On Adobe's site all PPDs are in Windows-self-extracting ".EXE" archives. To uncompress them, enter

unzip -L [filename].EXE

at the command line.

Put the file into the /usr/share/cups/model/ directory or into one of its subdirectories and restart the CUPS daemon (to rebuild the PPD database) by entering:

service cups restart

Now you can configure your printer as shown. For the PPD file which you have copied there will be a new entry in the list of printer models, just choose it.

When you have installed the new queue, set up the default options for the printer. Besides the usual things like the paper size and the resolution you should check whether there is a group of options called "Installed Options" or similar: here you should enter how much memory your printer has, which finishers are installed, how many trays there are and so on. This is very important, otherwise the users cannot take advantage of all the capabilities the printer offers. If you do not know exactly what is installed in your printer, you can often print an info page. The appropriate function is either available via the printer's built-in operation panel or via the printer's web interface (for Ethernet-connected printers).

* article index * top

* Configuring The CUPS Daemon

The configuration of the CUPS daemon (broadcasting behavior, directories, access permissions, and so on) is stored in the file

/etc/cups/cupsd.conf

The entries in this file (which is similar to the configuration file of the WWW server Apache) are well commented. You can change the entries with any editor, but when you change something, do not forget to remove the hash mark ("#") at the beginning of the line, otherwise the line will be ignored.

After every change the CUPS daemon has to be restarted, enter

service cups restart

to do so.

A more comfortable, graphical solution is

kupsdconf

The program can be started either by typing kupsdconf at the command line, by choosing "Configuration"/"Printing"/"kupsdconf" in the desktop menu, or by choosing "File"/"Configure CUPS daemon" in KUPS. It shows all the options of the CUPS daemon in a tree view (click on the "CUPS print system" entry on the left hand side if you do not see any tree). When you click on "OK" your changes will be saved and the CUPS daemon will be restarted automatically to activate the changes.

Some hints:

  • "0" for a size or a quantity normally means something special, like "unlimited" or similar.

  • The line "Printcap /etc/printcap" ('kupsdconf': "Server"/"Misc") lets the CUPS daemon generate a simple '/etc/printcap' file only containing the names of the printers. This is necessary for printing from KDE programs and from many other applications.

  • Usually, the line "FilterLimit 0" ('kupsdconf': "Server"/"Misc") should allow an unlimited number of print jobs to be done simultaneously. Due to a bug in CUPS this does not work. Therefore in Linux Mandrake FilterLimit 999999 is used.

  • In Mandrake, ImplicitClasses Off ('kupsdconf': "Browsing") is set. This means that CUPS does not generate any printer classes automatically. If you set this options to "On", you automatically get a so-called "implicit" class for every set of eponymous printers.
    Example: You have an Ethernet-connected printer and you define a queue for it on two servers, on both of them with the name "lp". With ImplicitClasses On you do not only get the two entries "lp@server1" and "lp@server2", you also get a class "lp", which forward printing jobs to the first of the two servers which responds. So you have redundancy: when one of the servers is down, you print through the other.

  • With BrowsePoll [server] or BrowsePoll [server]:[port] ('kupsdconf': "Browsing"/"Connection", [server] can be the name or the IP address of the desired server), you can poll the printer information from a server which is not in your local network. So you can also print on printers outside your local network.

  • With the line BrowseInterval 0 ('kupsdconf': "Browsing"/"Timeouts"), you can turn off broadcasting of your CUPS daemon. So other machines running CUPS do not get entries for your local printers and they will only be available on your machine.

* 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.