Subject: local filters and remote printer with lpd
To: None <netbsd-help@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: netbsd-help
Date: 04/03/2001 17:19:36
I am trying to configure lpd so it will process the data locally before
sending it to a remote server (which has the printer).

I have read through the manual pages (lpd and printcap) several times.

First I tried to create two printcap entries. One for "lp" which used a
"if" filter to process the data (ghostscript if needed) and then piped
this to lpr using the other "rlp" (remote printer) entry. But it would
never get to the second printer.

Then I tried using lpd with the "-r" option and then using a filter with
the "of=" setting. (Only one printcap entry for lp which is for the
remote.) But my remote lpd kept saying "protocol screwup" and "Your
printer job (stdin) was not printed because it was not linked to the
original file".

So I added some checks to my "of" filter and then I noticed that no data
was even going to it.

Can someone please explain the lpd "-r" option and the "of" printcap
configuration?

Right now (for the past several months), I do:
 - convert to postscript
 - process through gs (for my HP LaserJet 5)
 - transfer this new huge file to my computer with the printer
 - and then print it

It also worked with I piped it through gs and lpr (with -P pointing to my
remote configuration). But I want lpr to do the ghostscript processing
itself (if needed).

(Now that I think about this I should just make my own "lpr" shell script
that does these steps and ssh's the file over to the remote lpr. But then
it wouldn't queue locally if there was a problem.)

Any suggestions on how I can easily print to my remote printer?

Thanks,

   Jeremy C. Reed
   http://www.reedmedia.net/