Skip to main content.

2001-Apr-03

A few months ago I discussed on an OpenBSD newsgroup about patching lpd so it would allow filtering of jobs that are printed remotely. I never did it.

Today I saw that NetBSD's lpd has a "-r" switch that allows the "of" filter to be used. But I tried a few times, and I couldn't get it to work. I added logging to my filter and I noticed that the filter is executed but no data was going to it. I discussed this on netbsd-help; I was told that "lpd -r" appears to be broken, but FreeBSD's lpd can use the filters ("if" and "of") with remote printers.

So I found the old (April 1997) FreeBSD patch for lpd's printjob.c. It wouldn't patch cleanly so I did it manually. When done and using "lpd -r", I could print a postscript image that was processed locally ("of" used ghostscript) and printed remotely -- but then it processed it again (but no data and did plain text). The remote end only had one job though. It printed good (the first page), but the second page was a HP PCL XL error. My patch is at http://www.reedmedia.net/misc/netbsd/patches/printjob.c-diff. * I need to look at the patch closely, so it will only process once!