In order to get printing working well, you need to understand how your spooling software works. All systems work in essentially the same way, although the exact order might vary a bit, and some systems skip a step or two:
To print a job with CUPS, you can use both the BSD (see Section 5.3.1, “Printer compatibility list”) and System V commands making it really easy for people with prior experience with either system.
Initially CUPS lacked an LPD backend. This was of course quickly added. Currently there are backends available for at least IPP, LPD, SMB, JetDirect, USB, Netatalk, parallel and serial printers. You may find others on the net or write your own.
There are only a handfull of built-in drivers, allowing you to print with most printers but probably not at the maximum resolution. A PPD file for a Postscript driver can be added to CUPS but if you want to print at best quality with your fancy new HP Deskjet you are out of luck. It is here that Foomatic comes to the rescue. You can use Foomatic in combination with CUPS. Foomatic uses a CUPS filter called foomatic-rip to do its magic. foomatic-rip uses PPD files to describe printer capabilities, even for non-Postscript printers. CUPS + Foomatic is currently the recommended printing system. Some Linux distributions already use it and the number that do will only grow.
The CUPS scheduler does not only accept jobs, it is also a administrative webinterface. Currently you can add/delete printers, cancel jobs, start/stop printers. Moving jobs will be available in a later release.
Lpd stands for Line Printer Daemon, and refers in different contexts to both the daemon and the whole collection of programs which run print spooling. These are:
The spooling daemon. One of these runs to control everything on a machine, AND one is run per printer while the printer is printing.
The user spooling command. Lpr contacts lpd and injects a new print job into the spool.
Lists the jobs in a print queue.
The Lpd system control command. With lpc you can stop, start, reorder, etc, the print queues.
lprm removes a job from the print spool.
So how does it fit together? The following things happen:
if
attribute in/etc/printcap
) for this job and sends the
resulting data on to the printer.The lp system was originally designed when most printers were line
printers - that is, people mostly printed plain ASCII. By placing
all sorts of magic in the if
filter, modern
printing needs can be met with lpd (well, more
or less; many other systems do a better job).
There are many programs useful for writing LPD filters. Among them are:
Ghostscript is a host-based Postscript interpreter (aka a Raster Image Processor or RIP). It accepts Postscript and produces output in various printer languages or a number of graphics formats. Ghostscript is covered in Section 10, “Ghostscript.”.
ppdfilt is a standalone version of a CUPS component. It filters Postscript, executing a few basic transformations on it (n-up printing, multiple copies, etc) and adding in user option statements according to a Postscript Printer Definition (PPD) file usually included with Postscript printers.
ppdfilt is best used together with an option-accepting LPD system (like the GNUlpr, or LPRng) and a filter script which parses user-provided options into the equivalent ppdfilt command. VA Linux and HP provide a modified rhs-printfilters package which does exactly this; it produces nice results if you have a Postscript printer. See Section 8.2.2, “LPD for PostScript Printers” for information on this system.
ps2ps is a utility script included with Ghostscript. It filters Postscript into more streamlined Postscript, possibly at a lower Language Level. This is useful if you have an older Postscript printer; most modern software produces modern Postscript.
mpage is a utility which accepts text or Postscript, and generates n-up output—that is, output with several page images on each piece of paper. There are actually several programs which do this, includingenscript, nenscript, anda2ps.
a2ps, aka any-to-ps, is a program which accepts a variety of file types and converts them to Postscript for printing.