How to add a Foomatic PPD to your CUPS installation?

Author: Robert van den Aker (robert2 AT dds DOT nl)
Version: 2006.05.07.0


The (optional) foomatic-filters package includes the foomatic-rip filter script from the website. This script is a clever hack to allow the use of 'traditional' ghostscript devices with CUPS. Some background information about foomatic-rip, its use of traditional ghostscript devices, and how these differ from the special "cups" ghostscript device, can be found on this page.
Native CUPS printer filters do not use any of the traditional ghostscript devices; they only use the special "cups" ghostscript device. However, very few driver distributions provide native CUPS filters, and the foomatic-rip trick comes in handy in many cases. An excellent driver distribution that does provide native CUPS filters and accompanying PPDs for hundreds of printer models is Gimp-Print. If you installed the gimp-print-cups package, chances are that your printer is supported by it. Your printer may also be supported by one of the 'sample' CUPS drivers included in the cups package. If your printer is not supported by either of these driver packages, you may yet be able to find a Foomatic PPD for your printer. So what are those Foomatic PPDs?

PPDs and the CUPS filtering chain

PPDs are PostScript Printer Description files. The PPD specification was originally developed as an interface to control printer options for PostScript printers, but in CUPS they are used for all types of printers. If you want more background about the CUPS filtering chain and its use of PPDs, read this article. The gist is that PPDs determine the route that print jobs take through the CUPS filtering chain, most importantly the RIP filter to be used. This can be either one of the native CUPS filters or foomatic-rip. All the different native CUPS filters (controlled by PPDs for hundreds of different printer models) require only one ghostscript device: the special "cups" device. The foomatic-rip filter does not use the "cups" ghostscript device. It uses 'traditional' ghostscript devices such as "cdj500", "pcl3", "ijs", etcetera instead. Different PPDs that use foomatic-rip often require different ghostscript devices.

Printer drivers, ghostscript devices and external ghostscript filters

In the olden days, every printer driver was a separate ghostscript device. This meant you had to recompile ghostscript for every new printer driver. A newer method is to have a common ghostscript device call an external program (also called a filter; distinct from CUPS filters), which controls the printer options for the different models supported by the filter. This means you do not need to recompile ghostscript every time a new printer model comes out; you just update the external filter program. One of these external ghostscript filters is "hpijs". It can be used in tandem with either the (oldish) "hpijs" ghostscript device or the (new) "ijs" ghostscript device.
Foomatic PPDs for the hpijs ghostscript filter are provided by the hpijs-ppds package and will already be installed and available for selection in the CUPS web interface if you installed that package. Other Foomatic PPDs need to be downloaded from the website and installed according to the instructions below.

Example installation of a Foomatic PPD

In this example we'll locate, download, and install a Foomatic PPD for my HP DeskJet 400. This printer -- like almost all HP printers -- is already supported by one of the 'sample' CUPS filters and by Gimp-Print, which I also have installed, so I do not strictly need a Foomatic PPD to use this printer. In addition, if I want to use a Foomatic PPD, the Foomatic PPD for hpijs for this printer was already installed by the hpijs-ppds package, so I can use the hpijs driver (the recommended driver for this printer, as we shall see) right away. However, I'll add another Foomatic PPD for my printer for the sake of the example.

Step 1: locate the Foomatic PPD for your printer model

Go to and choose "Printer Listings" under "The Database", or go there directly by following this link.
I choose the HP DeskJet 400, which takes me to this page.
As you can see, there are many drivers to choose from for my printer: hpijs, cdj500, hpdj, pcl3, stp, hpijs-rss, gimp-print, and gimp-print-ijs. We can quickly discard three of these: stp is the old 'traditional' ghostscript device from the Gimp-Print distribution; gimp-print is the new "stp" ghostscript device; gimp-print-ijs is the external ghostscript filter from the Gimp-Print distribution that uses the "ijs" ghostscript device. We're not going to use any of these: if we want a Gimp-Print driver, we'll use the native CUPS filters provided by the gimp-print-cups package.
We can also discard hpijs-rss as an older, albeit patched, version of hpijs than the one we have installed, and hpdj as an older version of the pcl3 driver.
This leaves us with three choices: hpijs, cdj500, and pcl3. hpijs is the recommended driver for the HP DeskJet 400 and we would normally download the PPD for hpijs, but since it was already installed by the hpijs package, we'll choose the cdj500 driver for this example.
The page says that the type of the cdj500 driver is "Ghostscript". This means that you need to have the "cdj500" device compiled into ghostscript if you want to use the cdj500 PPD. To find out what devices were compiled into ghostscript, examine the output of the gs -h command (the "ghostscript" command executed with the "help" switch). You may want to pipe the output through "less" for easier reading ( gs -h |less ). Lucky for us, "cdj500" is listed, so we can use this PPD. The astute will have spotted the "pcl3" device, the "ijs" device, which is used by the hpijs ghostscript filter, and the "cups" device, which is used by the native CUPS filters, among the available devices.

Step 2: download the Foomatic PPD for your printer model

Click the "download PPD" link. If your browser has trouble setting a reasonable filename for the PPD, you can rename it after downloading to the name suggested in the PPD. The extension must be .ppd and the file must be world-readable.

Step 3: install the Foomatic PPD for your printer model

After downloading (and possibly renaming) the PPD, you need to put it in the right place. PPDs go in /usr/share/cups/model/. You can put it in a subdirectory if you prefer. You can also compress it with gzip if you like. I put the compressed PPD HP-DeskJet_400-cdj500.ppd.gz in the /usr/share/cups/model/foomatic-ppds/HP/ directory that was created by the hpijs package.

Step 4: reload cupsd

Next you need to reload cupsd (as root) to register the new PPD.

[root@hostname root]# /sbin/e-smith/service cupsd sighup

Step 5: add a printer that uses the new Foomatic PPD

Finally you need to add a (filtering) printer that uses the new PPD, as explained in this howto.
The PPD adds a new "model" to the CUPS web interface. The PPD that I installed in the example adds the "HP DeskJet 400, Foomatic + cdj500 (en)" model in the "Hewlett-Packard" category. I had to change some of the driver settings (this is done through the "Configure Printer" option on the printers page in the CUPS web interface) before I was able to successfully print a test page. The only "color mode" that worked with my black ink cartridge was "Floyd-Steinberg Gray". I was not pleased with the result of the test page: printing was dead slow and the output quality rather poor. I then installed the PPD for the "pcl3" driver, and that was much better, so I removed the printer that used the "cdj500" driver and kept the "pcl3" printer.

This document is Copyright 2003-2006 by Robert van den Aker. It may be freely redistributed in its entirety provided that this copyright notice is not removed.