Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
From: LaBonte <labonte@zk3.dec.com>
Subject: Re: Printer filter
Date: 2000/01/11	[thread overview]
Message-ID: <387B331B.6B0D67B@zk3.dec.com> (raw)
In-Reply-To: 387A4580.1967B38C@dassic.com


> Should I understand this as filtering _only_ works when defining a
> remote printer as a TCP/IP printer with portnumber ?

Yes that is correct, filtering is available for every connection method
except lpd remote.

> In your example you use both a if and a of filter... I've seen this in
> examples too, but I'm not sure I understand why... can you explain why I
> need to define a filter both as if and of ?

The output filter processes the lpd generated text banner page. The
input filter processes the file and provides accounting.  When a job
contains multiple files an input filter is started for each file.

Lpd inserts special characters in the banner page that must be detected by
the output filter. I recommend using an OS provided filter for the output
filter.

> I use the af part to tell the script what printer (stuff before the dot)
> to print to when the data is filtered, and what kind of printer (stuff
> after the dot) it is, so the filter (/usr/local/bin/printfilter.sh) know
> what to do.
> The printfilter is a custom written script that does alot of stuff to
> the data running thru.

Instead of using the accounting file argument to pass additional
information add it after the filter specification using filter specific
switches. In the printcap example I used -a and -b.

The new tcp/ip queue should look similar to:

vojens1|VOJENS1:\
        :ct=tcp:\
        :if=/usr/local/bin/printfilter.sh -avojens1_filtreret -bdde1070:\
        :lf=/usr/adm/lpd/vojens1.err:\
        :lp=@vojens1/dde_nct2_2070:\
        :mx#0:\
        :of=/usr/lbin/lpf:\
        :pl#66:\
        :pw#80:\
        :sd=/usr/spool/lpd/vojens1:\
        :sh:\
        :xf=/usr/lbin/xf:

The XF setting specifies the filter to process the lpr -x switch. By default
this is set to the xf (transparent or pass-thru) filter script.

OF has been configured to use the lpf print filter. I'm sure there is a better

choice but I don't know your OS version or printer make/model. Suggestions:

pcl printer             :of=/usr/lbin/pcfof +Chpdj680c.pcf:\
text printer            :of=/usr/lbin/pcfof +Cgeneric_text.pcf:\
PostScript printer      :of=/usr/lbin/ln03rof:\


--------------------
Jesper Frank Nemholt wrote:

> LaBonte wrote:
> >
> > If the printer has a network interface you can probably use tcp/ip
> > printing, provided in V4.0a, eliminating the need for two queues.
> > A tcp/ip print queue looks similar to a parallel port queue with the
> > exception of LP. For example:
> >
> >         :lp=@printer.name.com/port_9100:\
> >
> > Port_9100 is defined in the /etc/services file. ie:
> >
> >         port_9100       9100/tcp
> >
> > FYI, 9100 is the port/socket number used for HP and Lexmark printers.
> >
> > Using this setup you have a direct network connection to the printer with
> > full print filter functionality. Printcap example:
>
> Should I understand this as filtering _only_ works when defining a
> remote printer as a TCP/IP printer with portnumber ?
>
> I have tried filtering on remote printers, but I don't remember if I've
> tried with TCP/IP printers, so I'll try that again.
>
> In your example you use both a if and a of filter... I've seen this in
> examples too, but I'm not sure I understand why... can you explain why I
> need to define a filter both as if and of ?
>
> My printers look like this right now :
>
> vojens1|VOJENS1:\
>         :lf=/usr/adm/lpd/vojens1.err:\
>         :lp=/dev/null:\
>         :sh:\
>         :sd=/usr/spool/lpd/vojens1:\
>         :if=/usr/local/bin/printfilter.sh:\
>         :af=vojens1_filtreret.dde1070:
> vojens1_filtreret:\
>         :sh:\
>         :lf=/usr/adm/lpd/vojens1_filtreret.err:\
>         :ct=tcp:\
>         :lp=@vojens1/dde_nct2_2070:\
>         :sd=/usr/spool/lpd/vojens1_filtreret:
>
> I use the af part to tell the script what printer (stuff before the dot)
> to print to when the data is filtered, and what kind of printer (stuff
> after the dot) it is, so the filter (/usr/local/bin/printfilter.sh) know
> what to do.
> The printfilter is a custom written script that does alot of stuff to
> the data running thru.
>
> I'd _really_ like to get rid of the dummy queue.
>
> l8r/Jspr




  reply	other threads:[~2000-01-11  5:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-01-04  5:00 Printer filter Mustafa Demirbilek
2000-01-04  5:00 ` Jesper Frank Nemholt
2000-01-05  5:00   ` LaBonte
2000-01-10  5:00     ` Jesper Frank Nemholt
2000-01-11  5:00       ` LaBonte [this message]
2000-01-05  5:00   ` Sue Gleeson
2000-01-10  5:00     ` Forskningsing. vid Maskinsektionens DataCentral
2000-01-05  5:00 ` LaBonte
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox