PCL input Filter with GhostPCL
md at hudora.de
Tue Jun 5 12:27:18 PDT 2007
I have an legacy application (AS/400 based) that prints PCL output to cups. This works somewhat in RAW mode with PCL printers. But I want to use non-PCL printers and some of the more interesting CUPS features. So I went down the GhostPCL route which gets mentioned occasionaly here in the forum.
The Idea is to see PCL as just another input format like PNG, TEXT or PDF and convert it to PS for further processing by CUPS.
I compiled GhostPCL and wrote a cups input filter along this lines:
bigwheel# cat /usr/local/libexec/cups/filter/pcltopdf
[ -n "$6" ] && exec <"$6"
/usr/local/bin/pcl6 -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=- -
bigwheel# /usr/local/libexec/cups/filter/pcltopdf < test.pcl > test.pdf
I veriefied the filter worked.
Now I added simple PCL detection into /usr/local/etc/cups/mime.types and removed raw support:
#application/vnd.cups-raw (string(0,<1B>E) + !string(2,<1B>%0B)) \
I added the filter to /usr/local/etc/cups/mime.convs and restarted cups:
application/vnd.hp-PCL application/pdf 65 pcl2pdf
And get something like that:
D [...] print_job: auto-typing file...
D [...] print_job: request file type is application/vnd.hp-pcl.
D [...] Print-Job client-error-document-format-not-supported: Unsupported format 'application/vnd.hp-pcl'!
D [...] cupsdProcessIPPRequest: 14 status_code=40a (client-error-document-format-not-supported)
/usr/local/bin/lpr: Unsupported format 'application/vnd.hp-pcl'!
To me this indicates that the mime.convs configuration does not work as expected. Do I miss something here?
More information about the cups