[cups.general] Using a Perl script backend to handle a printfile

Michael R Sweet msweet at apple.com
Sun Mar 8 21:52:46 PDT 2009


David Coventry wrote:
> I have placed a simple Perl script in /usr/lib/cups/backed

Your Perl script is reading from stdin, but based on the command you
used to create the queue it will always get the print file on the
command-line...

> ...
> However, the print file is generated in /va/spool/cups and not in
> /var/spool/cups/pdf as I would expect. Also the filename as passed to
> /tmp/test.prn is of the order /var/spool/cups/d00014-001 as opposed
> to the actual file generated, which is /var/spool/cups/c00014.

The "c" files are the job control files which contain the current IPP
attributes for each job.  The "d" files are the job document files
which will be in whatever format the user submits - if you get the
print file on the command-line (which is what happens for raw queues),
look at the CONTENT_TYPE environment variable for the file type.

> Furthermore the file does not contain raw text as expected.

Are you printing raw text files?

> Can anyone suggest how I can:
> 
> a) make sure that the script is passed the correct file name and b)
> ensure that the file generated is plain text.

a) it *is* being passed the correct filename, and b) you can't unless
you provide filters and a PPD file that tells CUPS about those
filters.

If you only want to accept plain text files, then a PPD file
containing a cupsFilter line for text/plain should do the trick:

     *PPD-Adobe: "4.3"
     *NickName: "My PDF text printer"
     *cupsFilter: "text/plain 0 -"

-- 
______________________________________________________________________
Michael R Sweet                        Senior Printing System Engineer





More information about the cups mailing list