From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f678f,f4f8137c92629637 X-Google-Attributes: gidf678f,public X-Google-Thread: fee84,f4f8137c92629637 X-Google-Attributes: gidfee84,public From: LaBonte Subject: Re: Printer filter Date: 2000/01/11 Message-ID: <387B331B.6B0D67B@zk3.dec.com>#1/1 X-Deja-AN: 571174358 Content-Transfer-Encoding: 7bit References: <38725431.E9502406@dassic.com> <38735283.651B2E84@zk3.dec.com> <387A4580.1967B38C@dassic.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: iass@lead.zk3.dec.com X-Trace: lead.zk3.dec.com 947598109 16319 16.140.32.102 (11 Jan 2000 13:41:49 GMT) Organization: UBPG Mime-Version: 1.0 NNTP-Posting-Date: 11 Jan 2000 13:41:49 GMT Newsgroups: comp.unix.osf.misc,comp.unix.osf.osf1 > 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