CUPS printing to HP LaserJet

Printing under Linux has rarely been intuitive. When it’s finally configured properly, it tends to work reliably. First, you have to configure it correctly.

None of the documentation I came across when configuring CUPS for printing to a PostScript compatible printer indicated I needed to head to the vendor’s Web site, download their Microsoft Windows drivers, extract them, and grab the included .ppd file for proper printing to a PostScript printer. However, such is the case.

KDE 3.4’s documentation includes an excellent summary on why the .ppd is so important and hints at why the stock ones included with CUPS simply won’t work very well.

In this instance, I configured CUPS to print to a HP LaserJet 2200 DN printer.

For the .ppd I waded through HP’s Web site to locate the driver downloads. Their site perpetually timed out, so I eventually gave up and found a copy of the driver at printer-drivers.com. I utilized bugmenot to obtain a working login and password, then downloaded the Windows XP drivers for the HP LaserJet 2200 DN.

Once extracted, I located hp2200_7.ppd, our magic file. I moved it into /etc/cups/ppd as MaybeHP.ppd, the name of my printer’s entry. Now CUPS will give this .ppd preference when using this printer entry.

# mv /tmp/sillydriver/WinXP/stuff/hp2200_7.ppd /etc/cups/ppd/MaybeHP.ppd

Once that’s complete, you can do useful things like select which printer tray you want to use, which may be important. You can adjust other settings, too, although the HP 2200 doesn’t have many interesting features.

Optionally, you can print from the command line. (Obviously this assumes you have a printer entry named MaybeHP in your /etc/cups/printers.conf. Use your printer’s name.)

$ lpr -PMaybeHP -o InputSlot=lower /tmp/foo.ps

If you search for InputSlot in the .ppd file for your printer, you will learn the options that your printer accepts. Yes, case matters.

Now, your printer won’t spew 1,000 pages of crap when you tray to print to a different try because you thought using CUPS’ stock .ppd for HP printers was correct.