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

Helge Blischke helgeblischke at web.de
Thu May 2 04:13:56 PDT 2019


> Am 02.05.2019 um 08:25 schrieb Henrik Morsing <henrik at morsing.cc>:
> […]

Cups determines the file type by applying the rules listed in the files
/usr/share/cups/mime/*.types
and
/etc/cups/*.types

The default mime.types file designates a file as application/postscript (among other conditions)
if the file name extension (the last characters after the last dot) is one of
ai
ps
eps
or even if the two character sequence
!%
is found at the very beginning of a text line within the first 4096 bytes of the file.

Because of this, the file is treated as a PostScript file.
OTOH, the filter gstopdf (from the cups-pdf package) itself checks if the input file
is either a PDF or a PostScript file depending on the first 4 or 2 characters
reading
%PDF
or
!%

If that is not the case, it outputs the error message „can\’t detect file type“.

Could you please post the first 4096 bytes of a sample file that exhibits this issue?

Helge



More information about the cups mailing list