SUMMARY: lpd print filter : how it works ?

From: hduc@airmoon.epa.nsw.gov.au
Date: Sun Jul 16 1995 - 22:00:46 CDT


Thanks for the numerous responses from the list. This list is great.

Nearly all said that the print filters are not applied when printing to
remote printers. Filtering is done on the remote host (the print server).
The filters only work on locally connected printers.

Because my remote printer is an Emulex network printer, I can not put the
filter there (the LPD server is built into the network printer device).
There are two methods to get around the problem. Both
methods trick the lpd daemon to think that it is printing to a local printer.
Method 1 works wonderfully for me.

Method 1: (suggested by Mike Cross at crossm1@sb.com
           and John Valdes at valdes.geosun.uchicago.edu)

All you have to do is read a real queue, outputing to /dev/null or to a
dummy device such as mknod /dev/lpprinter c 3 2. This
will then execute your input filter. The filter script then has to queue
the job to the remote printer queue. i.e

lp0 a real execution queue, which outputs to /dev/null, and has an
        input filter called fred.

lp1 a remote queue pointing to the real printer queue

the filter script fred would be
        #!/bin/sh
        cat - | /usr/local/bin/as2ps > /tmp/file.$$
        lpr -Plp1 /tmp/file.$$
        rm /tmp/file.$$

whre as2ps is the ascii to postscript converter.

In my case, the printcap entry would be

lp0|lda1a:\
        :lp=/dev/null:\
        :sf:sb:\
        :mx#0:\
        :if=/usr/spool/net_ps/fred:\
        :sd=/var/spool/lda1a:

lp1|lda1a_ps:\
        :lp=:\
        :rm=elda1a:\
        :sf:sb:\
        :mx#0:\
        :sd=/var/spool/lda1a_ps:

Method 2: (suggested by Dave Fetrow at fetrow@orac.biostat.washington.edu)

Use the program from HP which connects a pseudo tty to the remote
printer. As far as the workstation is concerned the printer is connected
locally. The remote printer gets its info over lpd. The workstation does
the spooling. Get it from ftp.hp.com.

I have not tried this method yet. But it makes me think and reread the
Emulex printer manual. The Emulex also has a network socket program which
acts as an output filter to a dummy print device (eg /dev/null). It talks
to the remote print server and send the job to the remoted lpd.

As I mentioned before, Method 1 works great for me and is simple. So I
used it.

Thanks for the responses from these people.

Ian MacPhedran Ian_Macphedran@dvinci.usask.ca
Zenon Dewicki dewicki@bns102.bng.ge.com
Mike Cross crossm1@sb.com
Dave Fetrow fetrow@orac.biostat.washington.edu
Stuart Pearlman stuart@ffxsn6.to.mobil.com
Torben Lauritsen tl@gam0.phy.anl.gov
Bill Holzapfel billh@dcvast.com
Bismark Espinoza bismark@alta.jpl.nasa.gov
Bob Corbett bob@singapore.geco-prakla.slb.com
Thad Macmillan thadm@syst.oregonian.com
John Valdes valdes@geosun.uchicago.edu

*************************************************************************
Dr Hiep Duc, Metropolitan Air Quality Study* hduc@airmoon.epa.nsw.gov.au*
Environment Protection Authority NSW (EPANSW)* ------------------------ *
66 Rickard Road * *
Bankstown, NSW 2200 ph: (02) 7955205 * *
   ph: (02) 795 5454 Fax: (02) 7092836 * *
*************************************************************************



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:10:29 CDT