lpdpipe

I wanted to print some documents from my Linux workstation using remote print servers running on Linux/Unix and Windows 2000. So I searched for a lightweight lpd/lpr-spooler. There are three generic systems:

All these systems install at least one server daemon on port 515/tcp. This is useless for a workstation from which you want to print using a central, remote print server. So I wrote lpdpipe, which shares the same basic ideas with smtppipe.
lpdpipe hands over the files specified on the command line to a filter, which converts them either to postscript and/or a proprietary format suitable for your printer. lpdpipe then sends that converted file to a remote lpd/lpr print server.

Configuration

You have to specify at least one printer queue in /etc/lpdpipe.conf or any other config file given by command line option -f. A config file consists of key/value pairs seperated by :, =, tab, space or any combination of these characters.
At the moment there are 5 keys recognized by lpdpipe. A comment line has to start with a '#'. Anything else (including empty lines!) yields an error.

key description
queue This defines a local printer spooler queue. Such a queue name can be used with the -q command line switch. Note that apsfilter needs to know how to handle files for this queue.
remotequeue This defines the name of the queue on the remote server. If you do not mention it in the config file, it defaults to the name given as local queue name. So you can define several local queues pointing to the same remote queue.
host hostname or IP address of the print server.
filter full path to your raster image processing (RIP) filter
args command line arguments to pass to the RIP filter; spaces separate arguments, unless they are escaped (prefixed by '\')

Command line options

usage: lpdpipe V0.3 - prints files on a remote lpd server

lpdpipe [-c <#n>] [-f ] [-h] [-l] [-q ] [file ...]

  -c      print each file n times (default: 1)
  -f      use configfile as configfile (default: /etc/lpdpipe.conf)
  -h      print this help screen
  -l      do not print anything, display status of the queue
  -q      use queue for printing or displaying status
          (default: first queue mentioned in configfile)
  -t      timeout (default: 10 seconds)
  file    print these documents; if not specified, read file from stdin

Examples

apsfilter

apsfilter gets the name of the queue through a spool directory named after the queue. lpdpipe creates such directories as /tmp/<queue> with mode 1777. I am not an apsfilter expert so I do not know whether apsfilter needs access to those directories. lpdpipe creates that directory by default if you don't specify any arguments in the config file:

queue = fs-1010kx
remotequeue = fs-1010kx
host = 192.168.33.6
filter = /usr/etc/apsfilter/basedir/bin/apsfilter

Note that you have to configure apsfilter for that, too.

Foomatic

Same as above, but using Foomatic with /etc/foomatic/direct/Kyocera_Mita_FS-1010_de.ppd:

queue = fs-1010kx
remotequeue = fs-1010kx
host = 192.168.33.6
filter = /usr/bin/foomatic-rip
args = -P Kyocera_Mita_FS-1010_de

On my Gentoo box I had to install a2ps to use Foomatic.

Foomatic with psnup

Same printer type, same remote queue as above, but piping through psnup to print 2 pages per sheet:

queue = fs-1010kx-2
remotequeue = fs-1010kx
host = 192.168.33.6
filter = /bin/sh
args = -c a2ps|psnup\ -2|foomatic-rip\ -P\ Kyocera_Mita_FS-1010_de

Wishlist

Download

Latest version: 0.3 (released 2010-03-06)

Useful links

apsfilter
ghostscript
Foomatic
a2ps