Using Output Filters in /etc/printcap

Using Output Filters in /etc/printcap

Post by Guy Berlin » Sun, 07 Apr 1996 04:00:00



I set up an output filter for a plotter that sizes the page to
fit the plotter roll. The filter worked fine last week; I was
able to type lpr -Pplotter filename.ps and have the postscript
file filtered correctly before it got passed to the plotter.
My printcap entry looks like:

################################################################
#
#HP Design Jet PostScript Plotter
#
plotter|HP Design Jet 650C PS Plotter:\
        :rm=pipeline:\
        :of=/usr/local/bin/plotter.of:\
        :sd=/var/spool/dj650c:\
        :rp=dj650c:\
        :lf=/var/spool/dj650c/ilog:\
        :sh:ms=-opost:
################################################################

Last Friday everything worked fine. Today, it doesn't work. The file
just gets printed directly to the plotter and the output filter
never gets invoked. Same printcap entry. Same filter. Same file.
As far as I know the line printer daemon is unchanged. What could
account for this mystery? Why would an output filter get ignored?
I tried creating a new device using a new output filter, it also
got ignored. Can someone kindly explain to me how to install
output filters correctly, or refer me to a reference for doing so?
I've read all the man pages that were directly relevant to this
question: printcap, lpr, etc, and I remain unenlightened.

Guy Berliner
--

 
 
 

Using Output Filters in /etc/printcap

Post by Joel M. Hoffm » Tue, 09 Apr 1996 04:00:00


Quote:>I set up an output filter [for lpr] for a plotter that sizes the page to
>fit the plotter roll. The filter worked fine last week; I was
>[...]
>Last Friday everything worked fine. Today, it doesn't work. The file

I've always found it easier to use an lpr shell script which calls the
real lpr, which offers a lot more freedom to me, and easier
customization.

I have a shell script "lpr" which processes lots of options, including
first/last page, resolution, file type, etc, and sends it to one of
two printers.  It's available on my (tiny) FTP site:  www.exc.com
(anonomous login) in /pub/lpr-joel/.

If you know any shell programming, you'll find it easy to customize.
It requires gs for printing ps files on non-ps-printers.  It required
dvilj2p for printing dvi files on lj printers, and dvips for printing
dvi files on ps printers, or via gs on lj printers (both are command
line options).

Enjoy.

-Joel

--
-----------------------------------------------------------------------------
|_|~~ Germany, Europe. 1940's ``A DISTINGUISHED speaker said that we must put
__|~| 16 Million DEAD.          our children first.   We in Bosnia wonder  if
                                we have any children left. Seven* thousand
 cnc  Bosnia, Europe. 1990's    children  have been killed  in Bosnia in  the
 cnc  HOW MANY MORE?            last three  years.   Those living, some  with
                                gray hair and eyes and hearts of old men, are
``May the world you             hardly children any more.''
  live in be the world                             - H. Silajdzic
  of your dreams.'' - Debbie Friedman                Prime Minister of Bosnia
-----------------------------------------------------------------------------


 
 
 

Using Output Filters in /etc/printcap

Post by Mats Andtbac » Sat, 13 Apr 1996 04:00:00



Quote:>I set up an output filter for a plotter that sizes the page to
>fit the plotter roll.

the Printing-HOWTO used to say, if output filters really are the right
answer, it must've been a very silly question.

so - why an output filter in particular? i'll admit i've never resized
output pages to fit any plotters, but i can't imagine why an if filter
shouldn't be able to do that.

Quote:> The filter worked fine last week; I was
>able to type lpr -Pplotter filename.ps and have the postscript
>file filtered correctly before it got passed to the plotter.
>My printcap entry looks like:

>################################################################
>#
>#HP Design Jet PostScript Plotter
>#
>plotter|HP Design Jet 650C PS Plotter:\
>    :rm=pipeline:\

ah, here might be the answer - you're plotting on another box. then,
i'll grant that if filters wouldn't get run; arguably this is neater
than the normally recommended workaround with an if filter that feeds
its output thru lpr to another printcap entry. still, if the one works
and the other not...

Quote:>Last Friday everything worked fine. Today, it doesn't work. The file
>just gets printed directly to the plotter and the output filter
>never gets invoked. Same printcap entry. Same filter. Same file.

if nothing changed on your machine, did anything change on the remote
machine? yes, i know that shouldn't change what filters your box runs,
but with lpr one never knows... if all else fails, try that hack with
a bogus local printer with the if filter (which should always get run)
piping its output to the real (non-local) printer. hey, it might
work...

Quote:>As far as I know the line printer daemon is unchanged. What could
>account for this mystery? Why would an output filter get ignored?
>I tried creating a new device using a new output filter, it also
>got ignored. Can someone kindly explain to me how to install
>output filters correctly, or refer me to a reference for doing so?

see the Linux HOWTO's on http://sunsite.unc.edu/mdw/linux.html .
some of them are decent general-purpose Unix material, and the ones
that deal with printing ought to be relevant to most all bsd-style
unices.
--
 "vi is my shepherd; i shall not font. in the name of edlin, and ex,
  and the holy post. :wq"
 
 
 

1. printcap entries & output filters for specific printers

(This question must have already been asked a zillion times,
 in one form or another.  I checked a few FAQs; not there.)

I've been snooping about for a cheap letter-quality dot-matrix printer
to hang off my SPARCstation -- say, an Epson, Okidata, or Apple
ImageWriter.  Nothing fancy, no PostScript or other fancy page
description capabilities, just something that will accept literal
text.  The only wrinkle I can imagine is: where do I find the
appropriate printcap entries and lpd output filters?  The Admin's
Reference chapter "4.3BSD Line Printer Spooler" has remarkably little
to say about this.  I assume I can roll my own, but a directory of
working examples would still be a big help.

Also, assuming that I someday become wealthy enough to afford a
low-end laser printer, where do I find printcaps and output filters
for printers that _do_ speak page description languages?

Summary to follow if sufficient responses received.
Followups directed to comp.unix.admin.
Thanx.


 WARNING: article may contain flammable material.  Do not expose to open
   flames.  In case of accidental ignition, douse keyboard with water.

2. virtalhost

3. installing ghostscript as filter in /etc/printcap

4. OS/2 Boot Manager & LILO

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

6. NIS ypserv/ypbind registration ?

7. Filters and /etc/printcap

8. NIC promiscious mode

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

10. SUMMARY: Filters and /etc/printcap

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

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

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