SUMMARY: Filters and /etc/printcap

SUMMARY: Filters and /etc/printcap

Post by Jack Stewa » Wed, 03 Feb 1993 08:02:01

The filter(s) in /etc/printcap are only used on local attached
printers.  They are ignored when the file is to be sent to a remote
machine.  This is alluded to in the documentation, "4.3BSD Line
Printer Spooler Manual" by Ralph Campbell and becomes obvious when
looking at the source.

On a local printer, the filter reads from STDIN and writes to STDOUT.
Depending on the filter type, arguments (i.e. command line options) are
passed to it.  Anything that is written to STDERR will be logged in
the error file.

So in order to print to a remote printer with filters one of the
following tricks needs to be done.

1) Have a fake /dev/XXX that really opens a socket to the the remote
machine.  This is the approach that CAP uses.

2) Have a "filter" that instead of writing to STDOUT, opens a socket
to the remote machine.  At least of the printers here, an imagin, uses
this approach (the printer vendor supplied the "filters").

3) Replace lpd with a different printer deamon or rewrite lpd so that
it will use filters on files being send to remote machines...

#3 is probably the least elegant solution of all and probably more
trouble than it is worth.  I had considered writing my own filter.
But I talked to my print server vendor and they sending me a Unix
package that will allow me to create a fake /dev/XXX (In addition to
the "bug" fix/workaround).  So #1 is the approach that I will be using.

I want to thank everyone who responded and especially Vicky White for
pointing me to the documentation.


P.S. If you are going to write your own filter in Perl, you need to
open STDIN explicitly and not rely on the builtin <> mechanism.  The
<> builtin will try to open the arguments that lpd passes to it as


Caltech Concurrent Supercomputing Facilities,     Phone: 818-356-2153
Mail Code # 158-79, 391 S. Holliston,
Pasadena, CA 91125.                            #include  <std.disclaimer>


1. installing ghostscript as filter in /etc/printcap

I keep reading about how easy it is to install ghostscript as a print
filter to allow easy printing of Postscript files to non-postscript printers.
I still haven't seen an /etc/printcap with this implemented, however, nor
have I been able to find anything online with specific examples of how to
implement this, and AFAIK, it's not in the Ghostscript docs, either.

My present /etc/printcap is as follows:

hardcopy|hardcopy: \
   :lp=/dev/lp1: \
   :sd=/usr/spool/lpd/hardcopy: \
   :lf=/usr/spool/lpd/hardcopy/errs: \
   :mx#0: \
   :sh: \

Any and all help is appreciated.  Thanks.

<html><head><title>Down with HTML news postings!</title></head><body>
<h1><blink>If this line blinks, then it's time to get a newsreader that
doesn't encourage HTML news posting!  There are many that are better
than Netscape or IE; try trn!</blink></h1></body></html>

2. Need clue on SSA

3. Help needed: Ghostscript as /etc/printcap filter

4. Upgrade from RH5.2 to RH6.1

5. Filters and /etc/printcap

6. Transplanting INN into new Linux server?

7. Using Output Filters in /etc/printcap

8. KDE on AIX 5.1 L

9. How to set up filters in /etc/printcap?

10. /etc/printcap entry and filters for NEC SilentWriter 2 /90

11. Filter todos in the /etc/printcap file for IBM 4019 & HP Laserjet printer

12. Help with Slackware 7, /etc/printcap, filters, and TCP/IP Printing

13. Printcap -d filter (etc)