*.types, *.convs, filters, and cupsFilter
Paul
paul.conklin at cerner.com
Tue May 3 11:53:28 PDT 2011
The issue seems to spawn from PCL jobs being marked as vnd.cups-raw. I'm guessing there is something in cups that says, if in this format don't transform any more as I have been able to get around it by editing mime.types and mime.convs with the following:
mime.types
application/vnd.cups-pcl (string(0,<1B>E) + !string(2,<1B>%0B)) \
string(0,<1B>@) \
(contains(0,128,<1B>%-12345X) + \
(contains(0,4096,"LANGUAGE=PCL") \
contains(0,4096,"LANGUAGE = PCL")))
application/vnd.cups-raw
mime.convs
application/vnd.cups-pcl application/vnd.cups-raw 0 -
so this way it will autoconvert back to raw unless using my PPD that wants it to run through my filter.
Am I correct in my assumption about vnd.cups-raw? anyone have better ideas than what I've done? not terribly keen on editing the mime files since they start with DO NOT ADD TO THIS FILE
> sparing you all the long sad story as to the why, here is what I'm trying to accomplish. I want CUPS to ALWAYS call a filter script, regardless of type. it's working well except when I send a pcl type job, according to the mime.types as well as the c* file, it is matching as type application/vnd.cups-raw. I can make this model work by commenting out that type from mime.types, but I really don't want to. Ideas? Here is my current config. paultest is my filter name. Eventually i'm going to fine tune my types, but I did the hand of god approach first to just try and catch them all.
>
> paul.types
> application/paul
>
> paul.convs
> application/pdf application/paul 0 -
> application/postscript application/paul 0 -
> application/vnd.hp-HPGL application/paul 0 -
> image/gif application/paul 0 -
> image/png application/paul 0 -
> image/jpeg application/paul 0 -
> image/tiff application/paul 0 -
> image/x-photocd application/paul 0 -
> image/x-portable-anymap application/paul 0 -
> image/x-portable-bitmap application/paul 0 -
> image/x-portable-graymap application/paul 0 -
> image/x-portable-pixmap application/paul 0 -
> image/x-sgi-rgb application/paul 0 -
> image/x-xbitmap application/paul 0 -
> image/x-xpixmap application/paul 0 -
> image/x-sun-raster application/paul 0 -
> image/x-alias application/paul 0 -
> image/x-bitmap application/paul 0 -
> image/x-icon application/paul 0 -
> application/x-cshell application/paul 0 -
> application/x-perl application/paul 0 -
> application/x-shell application/paul 0 -
> application/x-csource application/paul 0 -
> text/html application/paul 0 -
> text/plain application/paul 0 -
> text/css application/paul 0 -
> application/rss+xml application/paul 0 -
> application/vnd.cups-command application/paul 0 -
> application/vnd.cups-form application/paul 0 -
> application/vnd.cups-pdf application/paul 0 -
> application/vnd.cups-postscript application/paul 0 -
> application/vnd.cups-ppd application/paul 0 -
> application/vnd.cups-raster application/paul 0 -
> application/vnd.cups-raw application/paul 0 -
> application/octet-stream application/paul 0 -
>
> PPD Line
> *cupsFilter: "application/paul 0 paultest"
>
> paultest
> #!/usr/bin/ksh
> echo "0:$0" >> $TMPDIR/$$.paul
> echo "1:$1" >> $TMPDIR/$$.paul
> echo "2:$2" >> $TMPDIR/$$.paul
> echo "3:$3" >> $TMPDIR/$$.paul
> echo "4:$4" >> $TMPDIR/$$.paul
> echo "5:$5" >> $TMPDIR/$$.paul
> echo "6:$6" >> $TMPDIR/$$.paul
> echo "APPLE_LANGUAGE: " $APPLE_LANGUAGE >> $TMPDIR/$$.paul
> echo "CHARSET: " $CHARSET >> $TMPDIR/$$.paul
> echo "CLASS: " $CLASS >> $TMPDIR/$$.paul
> echo "CONTENT_TYPE: " $CONTENT_TYPE >> $TMPDIR/$$.paul
> echo "CUPS_CACHEDIR: " $CUPS_CACHEDIR >> $TMPDIR/$$.paul
> echo "CUPS_DATADIR: " $CUPS_DATADIR >> $TMPDIR/$$.paul
> echo "CUPS_FILETYPE: " $CUPS_FILETYPE >> $TMPDIR/$$.paul
> echo "CUPS_SERVERROOT: " $CUPS_SERVERROOT >> $TMPDIR/$$.paul
> echo "DEVICE_URI: " $DEVICE_URI >> $TMPDIR/$$.paul
> echo "FINAL_CONTENT_TYPE: " $FINAL_CONTENT_TYPE >> $TMPDIR/$$.paul
> echo "LANG: " $LANG >> $TMPDIR/$$.paul
> echo "PPD: " $PPD >> $TMPDIR/$$.paul
> echo "PRINTER: " $PRINTER >> $TMPDIR/$$.paul
> echo "RIP_CACHE: " $RIP_CACHE >> $TMPDIR/$$.paul
> echo "TMPDIR: " $TMPDIR >> $TMPDIR/$$.paul
> echo "Library:" >> $TMPDIR/$$.paul
> grep 'CER_FORM' $PPD | cut -f2 -d':' >> $TMPDIR/$$.paul
> echo "Forms:" >> $TMPDIR/$$.paul
> lpoptions -d$PRINTER -l | grep *True | cut -f 1 -d ":" | cut -f 1 -d "/" >> $TMPDIR/$$.paul
> cat $6
More information about the cups
mailing list