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

Henrik Morsing henrik at morsing.cc
Thu May 2 07:51:15 PDT 2019


On Thu, May 02, 2019 at 04:36:18PM +0200, Till Kamppeter wrote:
>
>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
>

Just ran a strace on this and:

read(3, "\33%-12345X at PJL JOB\n at PJL SET FRONT"..., 4096) = 4096
write(2, "ERROR: Can't detect file type\n", 30ERROR: Can't detect file type

So it doesn't spot the %! in line 6:

head -6 d00285-001
2345X at PJL JOB
@PJL SET FRONTCOVERPRINT=OFF
@PJL SET FRONTCOVERPRINTTRAY=TRAY1
@PJL SET ECONOMODE=OFF
@PJL ENTER LANGUAGE=POSTSCRIPT
%!PS-Adobe-3.0

P.S. Did you write gstoraster?

Thanks
Henrik


More information about the cups mailing list