[cups] Can't detect file type / Not a PDF file

Till Kamppeter till.kamppeter at gmail.com
Thu May 2 07:36:18 PDT 2019


On 02/05/2019 16:10, Helge Blischke wrote:
> 
> I’d file a bug at openprinting.org for the gstoraster (and possibly other) filter(s)
> and suggest as a possible solution to read the environment variable
> CONTENT_TYPE
> instead
> and check the contents for
> application/postscript
> of
> application/pdf
> 
> It is not necessary to strip the HP control statements, as Ghostscript’s PS interpreter
> defines these as no ops.
>

The parse_doc_type() in the filter/gstoraster.c in cups-filters checks 
through the whole file whether a line starts with "%!" or "%PDF". If 
such a line gets found the file is considered PostScript or PDF 
respectively. So a PJL header does not prevent identification of the file.

You could also try to run the filter separately:

/usr/lib/cups/filter/gstoraster 1 1 1 1 "" d00285-001 > test.raster

or

/usr/lib/cups/filter/gstopdf 1 1 1 1 "" d00285-001 > test.pdf

Have a look at the screen output.

The second line also executes gstoraster but through a wrapper which 
makes gstoraster let Ghostscript output PDF instead of CUPS/PWG Raster.

Replace d00285-001 by whatever name your PJL-encapsulated PostScript 
file has.

    Till


> Helge
> _______________________________________________
> cups mailing list
> cups at cups.org
> https://lists.cups.org/mailman/listinfo/cups
> 



More information about the cups mailing list