save input file before filter processing

Paul Conklin paul.conklin at cerner.com
Thu Apr 19 07:09:36 PDT 2012


.convs
application/sample

.types
application/pdf			application/sample 0 -
application/postscript		application/sample 0 -
application/vnd.hp-HPGL		application/sample 0 -
image/gif			application/sample 0 -
image/png			application/sample 0 -
image/jpeg			application/sample 0 -
image/tiff			application/sample 0 -
image/x-photocd			application/sample 0 -
image/x-portable-anymap		application/sample 0 -
image/x-portable-bitmap		application/sample 0 -
image/x-portable-graymap	application/sample 0 -
image/x-portable-pixmap		application/sample 0 -
image/x-sgi-rgb			application/sample 0 -
image/x-xbitmap			application/sample 0 -
image/x-xpixmap			application/sample 0 -
image/x-sun-raster		application/sample 0 -
image/x-alias			application/sample 0 -
image/x-bitmap			application/sample 0 -
image/x-icon			application/sample 0 -
application/x-cshell		application/sample 0 -
application/x-perl		application/sample 0 -
application/x-shell		application/sample 0 -
application/x-csource		application/sample 0 -
text/html			application/sample 0 -
text/plain			application/sample 0 -
text/css			application/sample 0 -
application/rss+xml		application/sample 0 -
application/vnd.cups-command	application/sample 0 -
application/vnd.cups-form	application/sample 0 -
application/vnd.cups-pdf	application/sample 0 -
application/vnd.cups-postscript	application/sample 0 -
application/vnd.cups-ppd	application/sample 0 -
application/vnd.cups-raster	application/sample 0 -
application/vnd.cups-raw	application/sample 0 -
application/vnd.cups-pcl        application/sample 0 -
application/octet-stream	application/sample 0 -

add / replace this in your ppd

*cupsFilter:    "application/sample 0 samplefilter"

and then put your filter (called samplefilter in the above) in the filters directory.  match perms of other files in there.

> > Myska Ludek wrote:
> >
> > > I read documentation about file mime.convs.I found filter definition for
> > > printed file.I change the file with add lines:
> > >
> > > application/postscript application/psacoounting 100 psaccounting
> > > application/psaccounting application/vn.cups-postscript 100 pstops
> > >
> > > Then i place file to /usr/lib/cups/filters/psaccounting make executable
> > > for anyone with this content: ---
> > > #!/bin/bash
> > >
> > > echo $6 > /tmp/`date`.ps
> > > exit
> > > ---
> > > Just test script.But when i print poscript file nothing happend.No file in
> > > tmp. No error in cups log.Then i read documentation second time and i find
> > > line with recomendation to store own conv file to /etc/cups/.I dit it and
> > > nothing happend. How i change mime.convs file to make any change in filter
> > > processing?
> > >
> > >> Yes, there is.  $6 is the print job pre filters, you would just need to
> > >> insert your filter first in the chain via the .convs process
> > >> > Hi.
> > >> > I use windows generic postscript and cupsaddsmb to assing driver to
> > >> > printer and share this driver to network.Then i use tea4cups and
> > >> > pkpgcounter for job accounting a then send print to real backend with
> > >> > driver for printer.And here is a problem.If printert can print
> > >> > postscript there is no problem with accounting.If print use only
> > >> > pcl(5,5e,6) pkpgcounter dont work well but printing is fine. Is there a
> > >> > way to catch print job (postscript from windows clients) before run
> > >> > thrue filter pstopxl a send him to pkpgcounter or to another printer
> > >> > with tea4cups backend ?. I use Debian GNU/Linux 6.4 i386 in vmware and
> > >> > samba is connected to windows active directory.samba v3.5.4 and cups
> > >> > v1.4.4.Sorry for my bad english.
> > >>
> >
> > First, as your filter is not the very first one in the chain, $6 son't be
> > defined, instead the data are expected to be read from STDIN. And you need
> > to write the output of your filter (which is the input to the next filter or
> > the backend) to STDOUT.
> > So you script should do a check if $6 is defined, then use the cat command
> > to write your temp file, and then cat the temp file o STDOUT agein.
> >
> > Second, in your xxx.convs, you should write
> > application/vnd.cups-postscript
> >
> > Helge
> >
>
> Thanks.But the temp is never created.Every change in .convs file i made has no effect at all.My filter script is never executed.Can you place mi an example of .convs file where i see how modify file to place mi filter for application/postrict file ??
>





More information about the cups mailing list