* Printer filter
@ 2000-01-04 5:00 Mustafa Demirbilek
2000-01-04 5:00 ` Jesper Frank Nemholt
2000-01-05 5:00 ` LaBonte
0 siblings, 2 replies; 8+ messages in thread
From: Mustafa Demirbilek @ 2000-01-04 5:00 UTC (permalink / raw)
I have an application that produces aoutput for a dot matrix printer. Some
characters have to be replaced before they are sent to the printer. I tried
to add lines to /etc/printcap (if, of, etc) but could not succeed.
Does anybody have experience with filters?
Any advise is wellcome
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Printer filter
2000-01-04 5:00 Printer filter Mustafa Demirbilek
@ 2000-01-04 5:00 ` Jesper Frank Nemholt
2000-01-05 5:00 ` Sue Gleeson
2000-01-05 5:00 ` LaBonte
2000-01-05 5:00 ` LaBonte
1 sibling, 2 replies; 8+ messages in thread
From: Jesper Frank Nemholt @ 2000-01-04 5:00 UTC (permalink / raw)
Mustafa Demirbilek wrote:
>
> I have an application that produces aoutput for a dot matrix printer. Some
> characters have to be replaced before they are sent to the printer. I tried
> to add lines to /etc/printcap (if, of, etc) but could not succeed.
>
> Does anybody have experience with filters?
Sure.
If the printer is a remote printer, filtering won't work with if/of. The
trick in this case is (or can be) to make two queues, a local fake and
the real remote. Print to the local and let it call a if/of script that
translates the characters, and then at then end prints the result to the
remote queue. It's ugly but it works.
If you need to make a general solution, you can transfer parameters to
the if script using the af option. It's not intended for this use, but
again... it works. It'll show up as paramter $8 in the if script.
If you need an example I can post one. I have a ES40 cluster with about
400 printers configured like this.
I've never quite understood why if/of doesn't work with remote queues,
anyone ?
Will Advanced Printing solve some of these issues ?
l8r/Jspr
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Printer filter
2000-01-04 5:00 Printer filter Mustafa Demirbilek
2000-01-04 5:00 ` Jesper Frank Nemholt
@ 2000-01-05 5:00 ` LaBonte
1 sibling, 0 replies; 8+ messages in thread
From: LaBonte @ 2000-01-05 5:00 UTC (permalink / raw)
You can use the pcfof print filter to perform character substitution for
text printers.
Start by creating a printcap entry that uses the pcfof print filter.
The best setup depends on version of the operating system and the printer
make and model. Some suggestions are:
hp680c PCL printers.
generic_text Text printers.
generic_ansi ANSI printers.
After the printer setup is working edit the printcap entry change the
IF and OF settings. If the printcap entry has:
:if=/usr/lbin/pcfof +Cgeneric_text.pcf:\
:of=/usr/lbin/pcfof +Cgeneric_text.pcf:\
Change it to:
:if=/usr/lbin/pcfof +Cmy_generic_text.pcf:\
:of=/usr/lbin/pcfof +Cmy_generic_text.pcf:\
Copy /usr/lbin/pcf/generic_text.pcf to /usr/lbin/pcf/my_generic_text.pcf
and set the file protections to 644. All system provided pcf files are
replaced during system upgrades.
To create a character map file cd to /usr/lbin/pcf. Use your favorite text
editor and create test.map and insert the following lines:
':"
`:"
$:C\010=
The text must be left justified and the : character must be the second
character in the line. What does this file do?
':" Replace all ' characters with ".
`:" Replace all ` characters with ".
$:C\010= Replace all $ with C<backspace>=
to create a Euro symbol.
Save your changes and set the file protection to 644. Now edit
my_generic_text.pcf and look for the line:
character map file:
And replace it with:
character map file:/usr/lbin/pcf/test.map
For more information on PCF files look at the file template.pcf provided
in V4.0f and later.
The filter performs a blind substitution assuming the replacement character
occupies the same space as the original character. If this isn't the case
page formatting will be affected, for example character and column (tabs)
will not be vertically aligned.
--------------------
Mustafa Demirbilek wrote:
> I have an application that produces aoutput for a dot matrix printer. Some
> characters have to be replaced before they are sent to the printer. I tried
> to add lines to /etc/printcap (if, of, etc) but could not succeed.
>
> Does anybody have experience with filters?
>
> Any advise is wellcome
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Printer filter
2000-01-04 5:00 ` Jesper Frank Nemholt
2000-01-05 5:00 ` Sue Gleeson
@ 2000-01-05 5:00 ` LaBonte
2000-01-10 5:00 ` Jesper Frank Nemholt
1 sibling, 1 reply; 8+ messages in thread
From: LaBonte @ 2000-01-05 5:00 UTC (permalink / raw)
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:
lp|lp0|0:\
:ct=tcp:\
:af=/usr/adm/lpacct_lp0:\
:if=/usr/lbin/pcfof +Cgeneric_text.pcf:\
:lf=/usr/adm/lperr_lp0:\
:lp=@my_printer/port_9100:\
:mx#0:\
:of=/usr/lbin/pcfof +Cgeneric_text.pcf:\
:pl#66:\
:pw#80:\
:sd=/usr/spool/print/lp0:\
:xf=/usr/lbin/xf:
---------------------
Jesper Frank Nemholt wrote:
> Mustafa Demirbilek wrote:
> >
> > I have an application that produces aoutput for a dot matrix printer. Some
> > characters have to be replaced before they are sent to the printer. I tried
> > to add lines to /etc/printcap (if, of, etc) but could not succeed.
> >
> > Does anybody have experience with filters?
>
> Sure.
>
> If the printer is a remote printer, filtering won't work with if/of. The
> trick in this case is (or can be) to make two queues, a local fake and
> the real remote. Print to the local and let it call a if/of script that
> translates the characters, and then at then end prints the result to the
> remote queue. It's ugly but it works.
> If you need to make a general solution, you can transfer parameters to
> the if script using the af option. It's not intended for this use, but
> again... it works. It'll show up as paramter $8 in the if script.
>
> If you need an example I can post one. I have a ES40 cluster with about
> 400 printers configured like this.
>
> I've never quite understood why if/of doesn't work with remote queues,
> anyone ?
>
> Will Advanced Printing solve some of these issues ?
>
> l8r/Jspr
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Printer filter
2000-01-04 5:00 ` Jesper Frank Nemholt
@ 2000-01-05 5:00 ` Sue Gleeson
2000-01-10 5:00 ` Forskningsing. vid Maskinsektionens DataCentral
2000-01-05 5:00 ` LaBonte
1 sibling, 1 reply; 8+ messages in thread
From: Sue Gleeson @ 2000-01-05 5:00 UTC (permalink / raw)
In article <38725431.E9502406@dassic.com>,
Jesper Frank Nemholt <jfn@dassic.com> writes:
>
> Will Advanced Printing solve some of these issues ?
>
I believe it's somewhat easier to put the filter in place to achieve
the result desired by the original poster. Any shell script or program
which accepts stdin and writes to stdout can be used as a translation or
modification filter with Advanced Printing Software.
Sue
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Printer filter
2000-01-05 5:00 ` Sue Gleeson
@ 2000-01-10 5:00 ` Forskningsing. vid Maskinsektionens DataCentral
0 siblings, 0 replies; 8+ messages in thread
From: Forskningsing. vid Maskinsektionens DataCentral @ 2000-01-10 5:00 UTC (permalink / raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1108 bytes --]
In article <84vsmo$ele$1@lead.zk3.dec.com>,
gleeson@nofret.zk3.dec.com (Sue Gleeson) writes:
>In article <38725431.E9502406@dassic.com>,
> Jesper Frank Nemholt <jfn@dassic.com> writes:
>>
>> Will Advanced Printing solve some of these issues ?
>>
>
>I believe it's somewhat easier to put the filter in place to achieve
>the result desired by the original poster. Any shell script or program
>which accepts stdin and writes to stdout can be used as a translation or
>modification filter with Advanced Printing Software.
We have been using the version that shipped with T64 4.0F and there are
some functionality missing. For example:
Logging
Accounting
Finding the correct document type (PDF, PS, Ascii ...)
It is disabling the printers faster than we can re-enable them
and more.
Do anyone know if there is any plans for an upgrade / new version?
What is the relationship with Xerox' PrintXchange?
--
B�rje Sennung
Maskinsektionens DataCentral Telefon: +46 31 - 772 37 06
Chalmers Tekniska H�gskola Fax : +46 31 - 772 11 92
412 96 G�teborg Sweden E-mail : bse@me.chalmers.se
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Printer filter
2000-01-05 5:00 ` LaBonte
@ 2000-01-10 5:00 ` Jesper Frank Nemholt
2000-01-11 5:00 ` LaBonte
0 siblings, 1 reply; 8+ messages in thread
From: Jesper Frank Nemholt @ 2000-01-10 5:00 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Printer filter
2000-01-10 5:00 ` Jesper Frank Nemholt
@ 2000-01-11 5:00 ` LaBonte
0 siblings, 0 replies; 8+ messages in thread
From: LaBonte @ 2000-01-11 5:00 UTC (permalink / raw)
> 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
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2000-01-11 5:00 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-01-04 5:00 Printer filter Mustafa Demirbilek
2000-01-04 5:00 ` Jesper Frank Nemholt
2000-01-05 5:00 ` Sue Gleeson
2000-01-10 5:00 ` Forskningsing. vid Maskinsektionens DataCentral
2000-01-05 5:00 ` LaBonte
2000-01-10 5:00 ` Jesper Frank Nemholt
2000-01-11 5:00 ` LaBonte
2000-01-05 5:00 ` LaBonte
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox