[cups.general] CUPS filtering

Helge Blischke H.Blischke at srz-berlin.de
Fri Dec 10 06:52:46 PST 2004


Pascal DeMilly wrote:
> 
> Hi,
> 
> I have a legacy system that prints report in ascii only. I setup a cups
> server with a raw printer that basically mpage that ascii file into a PS
> (using -i script of lpadmin) and send the result to another CUPS printer
> which is a laserjet.
> 
> The problem that I am having is that the last printer in the chain does
> recognize that this file is a PS script file and that it should
> rasterize it before sending it to the PCL printer. It seems it sends it
> in raw format. How can I force that printer to do just that.
> 
> He is my script on the ascii to ps queue. The print queue was created as
> follow: lpadmin -p fs1-offc-1-aps -v ipp://fs1-offc-1-lnx/printers/local
> -m raw -i mpageit -E
> 
> #!/bin/sh
> 
> TMPFILE=/var/tmp/mpage.$$
> 
> if [ -f $6 ]; then
>    cp $6 $TMPFILE
> else
>    cat >$TMPFILE
> fi
> 
> [ "`wc -L $TMPFILE | awk '{print $1}'`" -gt 80 ] && opt="-l"
> mpage -m40lr -1 $opt -L66 $TMPFILE
> rm -f $TMPFILE
> 
> Here is a sample of the log of the last printer (Lexmark e232 setup as a
> laserjet) on fs1-offc-1-lnx. lpadmin -p local -v usb:/dev/usb/lp0 -m
> laserjet.ppd.gz -E
> 
> [log stripped off]

> Any help appreciated
> 
> Regards
> 
> Pascal

Well, mpage spits out PostScript, and you use a printer that talks
something else.
Thus, raw printing is not appropriate. 
Create a neew mime type, say text/foo, install your script as a CUPS
filter,
say foo_bar, and define a new conversion rule  in mime.convs as

text/foo application/postScript 33 foo_bar

Be careful when defining the mime type. The name msut be lexically lower
than 
text/plain so that the default text/plain does not get involved.

Helge

-- 
Helge Blischke
Softwareentwicklung
SRZ Berlin | Firmengruppe besscom
http://www.srz.de
tel: +49 30 75301-360




More information about the cups mailing list