Subject: Re: setting printer options in lpr
To: Webmaster Jim <jspath@mail.bcpl.lib.md.us>
From: Guenther Grau <s_grau@ira.uka.de>
List: netbsd-help
Date: 08/21/1996 19:54:00
Hi,

> I'll admit total igorance as to tweaking lpr queues, so could someone
> point me toward methods of doing the above?  I have set up different
> printcap entries for different printers.  This is a possible method for
> the different pitches (epson-10, epson-12), but how do I transmit the
> escape sequences in this case?

Hmm, this sounds pretty easy: Just implement a filter, that sends the 
needed escape-codes to the printer.

Assuming your printcap-entry looks like this:


epson-10:\
        :mx#0\
	:lp=/var/spool/lpd/epson-10\
        :if=/var/spool/lpd/epson-10/filter\
        :sh:

and 

/var/spool/lpd/epson-10/filter:

#!/bin/sh
echo "AsMuchESCAsYouWantToPutHereToSetAnythingInThePrinter:-)"
cat - 

You can do it a lot more sophisticated, but this is a simple
starter. You can put this script anywhere, just change the name
in the printcap and make sure that the script is executable,
i.e. chmod +x /var/spool/lpd/epson-10/filter.
There are some very good printer-filter floating around which you might
just grab. There is an excellent one, which checks what you are printing,
i.e. it checks it you are printing postscript or plain text or a dvi file
from tex and invokes the needed programs to convert this stuff to the proper
printer language. It uses ghostscript and other tools to do so, so these
have to be installed. Don't ask me where to find this printer-filter, I don't
know where it is. Maybe have a look at the linux printing howto?.

  Guenther