[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: CUPS and enscript



On Tue, Feb 05, 2002 at 12:21:44PM -0600, Dave Sherohman wrote:
| I'm in the process of migrating several systems from lpd to CUPS and
| it's going pretty well aside from one detail:  lpd has its if= in
| printcap, which provides an easy hook for throwing enscript filters
| into the printing process.  I haven't been able to find an equivalent
| hook in CUPS.

I'm not sure if this is the sort of thing you're looking for or not,
but for one particular queue I have this line in
/etc/cups/ppd/<printer_name>.ppd :

*cupsFilter:	"application/vnd.cups-postscript 0 cupsomatic"


This tells CUPS to use the given executable (binary or script or
whatever it is that the system can execute) in /usr/lib/cups/filter.

If I was in your position, I would try creating a shell script that
pipes through enscript.  Before I had the cupsomatic package, I used
this for that printer :

~~~~~~~~~~~~~~~~~~~~~~~
#!/bin/sh

# Windo~1 prints an extra page with :
#   %%[ Page: 1 ]%%
#   %%[ LastPage ]%%
# on it.  Get rid of it with sed first.
if [ "$7" != "" ] ; then
    sed -e "s/^.*%%\[ .*Page.* \]%%.*$//" | gs -sDEVICE=bjc600 -sOutputFile=- -q - < "$7" 
else
    sed -e "s/^.*%%\[.*Page.*\]%%.*$//" | gs -sDEVICE=bjc600 -sOutputFile=- -q -
fi
~~~~~~~~~~~~~~~~~~~~~~~


You could probaby stick enscript in there instead of gs.  (I figured
this out by reading the CUPS Programmers manual (point a web browser
at localhost:631) and looking at the filters specification)

-D

-- 

One man gives freely, yet gains even more;
another withholds unduly, but comes to poverty.
        Proverbs 11:24



Reply to: