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

MandrakeUser.Org - Your Mandrake-Linux Knowledge Base!

 
 

*DocIndex - Hardware - Article Index

Printing with CUPS

* Introduction
* Principles of CUPS
* Buying a Printer

Related Resources:

See Resources on article index

Modified: Nov 13, 2000
Author: Till Kamppeter

 

* Introduction

Did you envy the people working under Windows or Mac OS choosing their printers and doing the nicest stuff on them with a few mouse clicks? And you as a Linux user had to set up a separate queue for every combination of options you want to use? Or to write some tricky scripts to set up options like double sided printing, taking paper from the lower tray, adjusting colors, setting the paper type or photo quality? Or did your printer even have features which were not available to you in Linux?

The problem is that in all Linux distributions, including Linux Mandrake 7.1 and earlier, technology of the 70s was used for handling printing jobs. This system, LPD (Line Printer Daemon) was made for simple text printers (line printers) which had no or very few options. In Linux Mandrake 7.2, I have replaced this system by a new printing system which meets the needs of the users of modern printers. This system is CUPS, the Common Unix Printing System. I have fully integrated it as the default printing system and all printers which were supported under Mandrake 7.1 plus a lot of new ones are supported. So the still available LPD is only needed for some exceptional cases.

With CUPS, one can easily submit printing jobs together with options as paper source, type, size, resolution, double-sided printing, color/gray scale, and even color adjustment or usage of special finishing units as staplers or binders. For Postscript printers there are all the options available which are available under Windows/Mac OS, for non-Postscript models all options which are defined in their Linux (mostly Ghost Script) drivers.

CUPS does not only support printing with options, it also makes the administration of printers in networks much easier:
Besides having a web interface and a graphical tool for easy administration, CUPS broadcasts the information about local printers into the local network and the CUPS daemons running on the other machines pick up these signals and so all the printers are automatically available on all machines of the network. So one does not need to configure every machine when adding a printer or moving one to another server (with LPD one had to modify the /etc/printcap file on every machine in this case). CUPS supports all the important network printing protocols like SMB, LPD, AppSocket, and IPP.

* article index * top

* Principles of CUPS

Like most printing systems, CUPS is designed around a central print scheduling process. This process dispatches print jobs, processes administrative commands, provides printer status information to local and remote programs, and informs users as needed. This process is called either the scheduler or the CUPS daemon (in general a daemon is a program running in the background and processing requests from remote machines on the network or other events).

One big difference between CUPS and the old printing system LPD is that CUPS is completely based on the Internet Printing Protocol (IPP) as the protocol used for both the communication between the CUPS daemons in the network and between the CUPS front ends and the CUPS daemon. IPP is an extension of HTTP (Hypertext Transport Protocol, the way how WWW pages are transported on the Internet) to support remote printing. IPP is is not only used by CUPS, it is a new standard which is also used by some network printers and printer server boxes (e. g. HP JetDirect).

When one submits a printing job with one of the CUPS front ends (either System V/Berkeley-compatible command line programs or graphical front ends), one specifies the desired printer, options (as paper tray, resolution, color adjustments) and the file to print (can be Postscript, PDF, HP-GL/2, text, or an image). The front end checks whether the printer and the file exist and sends all the information to the locally running CUPS daemon or, when there is no CUPS daemon running on the local machine, to a remote CUPS daemon specified in a configuration file. This CUPS daemon determines to which machine the printer is connected to and hands the job over to the CUPS daemon on that machine, the server of the printer. The CUPS daemon puts the job into the printer queue and, as soon as the printer is free for a new job, the daemon sends the data through several filters before it is sent to the printer. The filters convert the file into a format which the printer understands and they apply the user-supplied and default options.

The general information about the printers is stored in a printer queue definition file. The printer-specific information (which options are available and which driver is needed by the printer) is stored in a so called "Postscript Printer Description" (PPD) file.
For Postscript printers the PPD file supplied by the printer manufacturer is used, like in Windows or Mac OS. For non-Postscript printers special PPD files (included in Linux Mandrake 7.2 or download-able from linuxprinting.org) are used. They contain CUPS-specific extensions which describe which filter is used to transfer the data from a format the CUPS filters can produce to a format which the printer understands and how this filter has to be called. In addition the PPD file contains the default settings for all printer-specific options.

The information about the printers is only stored on their servers; the CUPS daemons on the clients get the information via a server broadcast. The server sends information about the hosted printers to the local network every thirty seconds. The amount of information is very small, so that the network load induced by the broadcasting is negligible. The clients listen to these signals and collect the information for their own printer list in this way. They poll additional information from the server (as location and description of the printer or its PPD file) if necessary.
So you only need to configure the servers with printers, on the clients you do not need to configure anything: you simply start the CUPS daemon and you get a list of all available printers in the local network automatically. The broadcasting of the server, the listing of printers on the client, and the printer access can be restricted to selected machines, users, or groups, or it can even be password-protected. One can poll the printer information on any CUPS server accessible through a WAN or the Internet, so printing with CUPS is not restricted to the printers in the local network.

To make several different file types printable with CUPS, there is a sophisticated filter system: There is a MIME type file which lists the supported MIME types (text/plain, application/postscript, etc.) together with "magic" rules for automatically detecting whether a file is of this type, and there is a MIME conversion rule file which lists all available filters and which formats they can convert. CUPS determines with this information which filter chain has to be used to convert the format supplied by the user to the format understood by the printer. With this system one can easily extend CUPS by a new file format by adding a filter and entering the appropriate info to the MIME types/conversions files.

CUPS also supports printer classes. Classes are special printing queues with several assigned printers, and when you send a job to a class, the first printer responding will print the job. So you can set up clusters of (preferably similar printers) and the jobs will be equally distributed on them automatically.

For more information, see the Overview of CUPS 1.1 on the CUPS web site.

* article index * top

* Buying a Printer

If you do not have a printer yet (or need another one) you should choose carefully. There are a lot of printers not supported under Linux at all (especially "win printers", also called GDI printers) and if a printer is supported, its printout quality depends on the quality of the driver.

If you plan to buy a native Postscript printer, you can choose freely, they all work perfectly, whether they are black-and-white or color. You do not need to take care of whether they are listed on http://linuxprinting.org/ and how they are rated. All features as duplex, multiple paper trays, and even staplers, folders, binders or other finishing accessories are supported exactly in the same way as under Windows/Mac OS. It is necessary that the Postscript interpreter is built into the printer's hardware, though. There are also Postscript printers where a driver - which is only available for Windows - provides the Postscript interpreter. These printers are not supported (usually small lasers for home/workplace usage). All high-end lasers have built-in Postscript. So with high-end devices as color lasers or ultra-fast high-volume network printers, you can't go wrong.

For non-Postscript printers you should read Grant Taylors "Suggested Printers" page. In general you should choose a laser when you print many pages in black-and-white, and an ink jet for low volume color printing. Have both (one parallel and the other via USB), if you need color and black-and-white.

If you need a laser printer, you can get even hardware-Postscript printers in the lower price range (some Lexmark and Brother models). The PCL printers of HP and some other manufacturers are also well supported. Be careful, though, there are even some lasers which are "win printers", as the OKI Okipage 4w and compatible laser printers.

With some color ink jets you can even obtain photo quality. This is realized by the GIMP-Print driver. Especially Epson Stylus printers (except the 480) are recommended here. Because Epson publishes nearly all of their printer's specifications, they are excellently supported under Linux.

Never buy a so-called GDI- or "win printer". They are very cheap (starting at something like 50$), but that shows: they have no memory, no processor, etc. and so they do not understand standard protocols like PCL or Postscript. They only understand a proprietary bitmap protocol (not even simple text because they have no fonts), which is generated by their Windows drivers. The manufacturers neither publish their specifications nor write Linux drivers for these printers. Therefore it is very difficult to write Linux drivers for them and so there is only partial support for them in Linux Mandrake 7.2 (HP DeskJet PPA printers, Lexmark 1xxx, 2050, 2070, 3200, 5xxx, 7xxx, Z11, Z51, Z52).

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