LPRng with Foo2ZjS

NOTE: For awhile I was using only LPR instead of CUPs.  Then I acquired a HP 1522NF MFP requiring the HPLIP drivers.  HPLIP then required CUPs.  After configuring HPLIP, less the unneeded options, I then only required one or two packages for using CUPs.  Hence, I'm now using CUPs .  Printing with HPLIP drivers instead of using Foo2ZjS drivers is a little less prone to errors.  On the downside, the HPLIP drivers appear to be a blob of python.  The HPLIP drivers also appear to want to force users into using a GUI instead of the CLI -- but at least there is some CLI.  HPLIP also has plenty of open bugs.  Still, I'm slighltly better off having the HP 1522NF and HPLIP combo, as again, I'm less prone to printing errors. (2011.01.13 15:25)

Last Edited: Roger Thu Jan 13 13:05:22 AKST 2011

Reasoning for using LPRng instead of CUPS

One of the cons for using LPRng, there's very little user documentation concerning configuring the latest network style Hewlertt Packard printers using Foo2ZjS filter.  On the flip, it is extremely easy!  A likely reason for the lack of documentation, everybody is using CUPS.

Installing packages

The only packages needed for LPRng on my system, along with their own depends, were these:


First, set USE options to prevent pulling in default "cups" specific packages.  (Change "foo2zjs_devices_" to specify your specific printer.) /etc/portage/package.use: net-print/foo2zjs -cups foo2zjs_devices_hp2600n net-print/foomatic-filters -cups app-text/ghostscript-gpl -cups Then install the packages.
  # emerge -pv net-print/foo2zjs net-print/lprng
(If the above doesn't bring in the Enscript package, then "emerge app-text/enscript" as well.)

This should bring in approximately 14-19 packages.  Note, foomaticdb USE Flag is not needed as the Foo2ZJS provides the required PPD and filters. 

However, net-print/foo2zjs" package will only pull in the PPD files if the cups USE Flag is set.  Some options are; 1) Get the original source package from the author's webpage.  2) Or, if you already have the foo2zjs package installed with the cups USE Flag set, simpley copy over the PPD file.

Substitute the Foo2ZjS printer model with your printer model.
  # cp /usr/share/cups/model/HP-Color_LaserJet_2600n.ppd.gz /etc/foomatic/
  # cd /etc/foomatic
  # gzip -d HP-Color_LaserJet_2600n.ppd.gz

Editing configuration files.

Get the PPD file for your printer device and save it within /etc/foomatic or /etc/lprng folder.

Edit your page size and page color settings as needed within the PPD file as well as "/etc/enscript.cfg" and "/etc/papersize" paper sizes.  Default is usually A4.  (See papersize manfile for /etc/papersize options.)

Next, the famed printcap file and is a symlink to /etc/lprng/printcap.

  lp|2600n|HP Color LaserJet 2600n
    # Debug Level
    :filter_options= --lprng $Z /etc/foomatic/HP-Color_LaserJet_2600n.ppd
LPRng requires all files to have proper owners and permissions.

"/usr/bin/checkpc" is a utility for checking.  Ensure this is performed prior to printing including fixing any file owner/permission errors else printing will fail silently unless the debug flag is uncommented.  Any changes to the printcap file require a "/etc/init.d/lprng restart". (Using "lpc reread" seems not to work at most times here for some reason.)

Start the lprng rc service:
  # /etc/init.d/lprng start

Test Printing

This is pretty much all the configuring that is needed for LPRng with Foo2ZjS filter depending on your printer.  Now try printing.

If you are daring, and sure your setup works, then just do:

  $ enscript test.txt
A method of debugging is to uncomment the "db" flag within the printcap file then using within another root terminal:
  # tail -f /var/log/messages
At debug level one, there's a lot of output.  And with a little reading, you're pretty much assured of finding your error.

If you're still having problems, read the bottom of the Install.txt documentation of the Foo2ZjS package for instructions using Netcat and only the Foo2ZjS filters.  (Ensure you specify your own Foo2ZjS filter for your device within the Foo2ZjS Install.txt Netcat example.)