Gentoo Linux, HPLIP, and the HP LaserJet 1320 don’t mix

If you try following the advice at the Gentoo Wiki, you would install HPLIP and use its hp-setup utility to add the printer to your system.  That way, however, lies madness…and printer communication errors.  I think this was the previous source of errors when I was using a JetDirect 175x between the computer and printer, but it’s not behaving any better with a direct USB connection.

Here’s what I ended up doing to get my printer working:

  1. emerge -C hplip && emerge foomatic-db-engine && /etc/init.d/cupsd restart
  2. Make sure USB printing support (CONFIG_USB_PRINTER) is enabled in the kernel…note that genkernel builds a kernel without it!
  3. Generate a PPD:
    foomatic-ppdfile -p `foomatic-searchprinter "HP LaserJet 1320"` >lj1320.ppd
  4. Go into the CUPS web interface and add the printer.  It should show up as a USB device.  When the option comes up to provide CUPS a PPD file, take it and use the file generated in the previous step.
  5. Once set up, double-check the printer default options to make sure the right paper size is selected.  (I think this method defaults to letter, but HPLIP used A4 as the default.  Either way, make sure it’s correct for what you’re using.)

Figuring all that out was three hours I won’t get back due to either buggy software (it wasn’t this tricky to get running on Kubuntu) or inadequate documentation.  At least now it’s written down to save others the aggravation.