How to set up a printer on *BSD, using the line printer daemon

Discussion in 'all things UNIX' started by Gullible Jones, Jan 8, 2013.

Thread Status:
Not open for further replies.
  1. Disclaimer: This is not guaranteed to work. YMMV, as with all software.

    Anyway, because I'm feeling retro today...

    There used to be a program called apsfilter that let you interactively configure LPD's printcap file. Unfortunately it is unmaintained, and has been unusable for several years due to crippling bugs.

    Fortunately, there is an alternative - a script called foomatic-configure. It is not as friendly, but it works well enough. Unlike apsfilter it is not interactive. Its invocation looks something like this, for a Hewlette-Packard Deskjet 842C:

    foomatic-configure -s lpd -c file:/dev/ulpt0 -n DJ842C -P HP-Deskjet_842C -d gutenprint-ijs.5.2
    -s is the type of print spooler.
    -c is the interface, in this case the device node /dev/ulpt0 for the first USB printer.
    -n is the name for the print queue. This will be used when you invoke lpr to print stuff.
    -P is the ID of the printer type. You can get a list of available IDs with 'foomatic-configure -O'.
    -d is the specific driver. There may be several available for your printer, again viewable with 'foomatic-configure -O'

    There are other options, specified in the man page; the above are just the vital ones. Running the above command will add to your /etc/printcap file an entry that should work for an HP Deskjet 842C on the ulpt0 node; obviously you can substitute other device nodes, queue names, printer IDs, or drivers as necessary.

    Once your printcap file is configured, you can print a file - pretty much any printable file, AFAIK - like this:

    lpr -P DJ842C filename.txt
    Note that you may have to restart LPD to make it see the new print queue.
Thread Status:
Not open for further replies.