logo       Dave's Online Memory
using filters on remote printers You: 38.107.179.216 Friday May 25, 2012 8:55PM PDT | boston: Friday May 25, 2012 11:55PM EST/EDT

Unfortunately, lpd doesn't use filters when spooling to remote printers. To work around this problem, one can create two spools, a local spool that does the filtering, and then sends its output to the second spool on the remote printer. An example printcap would look something like:

# /etc/printcap
# "virtual" local printer to do filtering
lp:lp=/dev/null:mx#0:sh:sd=/var/spool/lpd/lp:if=/usr/bin/mylpfilter:
# real printer
remote:lp=:rm=printer.grox.net:rp=raw:mx#0:sh:sd=/var/spool/lpd/remote:

A sample filter (using the excellent magicfilter):

#!/bin/sh
# mylpfilter
magicfilter -c /etc/magicfilter/laser-filter | lpr -Premote

Speaking of magicfilter, I find that most of the mail that I print (eg, email confirmations for web purchases) would require two pages. I preprocess with enscript to fit most on a single page by changing the default entry in the magicfilter config (the last one) from cat to
default fpipe enscript -B -f Courier9 -o - $FILE 2>/dev/null
. Just my own personal pref...

updated: Fri Apr 14 15:09:02 EDT 2006
...dave

...dave


silly cat image Top of Page FEEDBACK      Comments, Corrections & Questions welcome