[cups.general] Printing PDFs

Johannes Meixner jsmeix at suse.de
Fri May 22 02:29:40 PDT 2009


Hello,

On May 20 11:33 John Satlar wrote (shortened):
> I am having problems configuring our server to print pdf files.
> We are attempting to receive a pdf from our mainframe, and
> originally we could not even get the job into queue.
> Finally found article recommending to un-comment
> application/octet-stream in mime.convs and mime.types.
> Doing this we were able to get the job in queue.
> However, when we attempt to print this file it is not
> recognized as a pdf and only raw data is printed.
> What am I overlooking?
>
> We are currently running SLES9 SP2 and CUPS 1.1.20-108.22

It seems that what you think is a PDF from your mainframe
is not recognized by CUPS as a PDF but as something else
(probably as an unsupported type of data which is rejected
because it cannot be converted into printer-specific data).

Inspect /var/log/cups/error_log on the CUPS server, see
http://en.opensuse.org/SDB:CUPS_in_a_Nutshell
"If problems are encountered"

See /etc/cups/mime.types how CUPS autodetects a PDF.
There should be something like
------------------------------------------------------------
application/pdf                 pdf string(0,%PDF)
------------------------------------------------------------
which means that a file is autodetected as PDF if
the very beginning(!) of the file is
------------------------------------------------------------
%PDF
------------------------------------------------------------

If the files from your mainframe have other stuff
at the beginning, you may need a separated MIME type like
------------------------------------------------------------------
application/mainframepdf  string(0,FooBar) + contains(0,4096,%PDF)
------------------------------------------------------------------
together with a selfmade filter which converts
application/mainframepdf into application/pdf
by cutting away whatever non-PDF stuff from the beginning
to make sure that the CUPS filtering system can process
the remaining data correctly as PDF data, see
http://en.opensuse.org/SDB:Using_Your_Own_Filters_to_Print_with_CUPS
"Adding Additional Filter Stages to the Default CUPS Filter System"


Or does your mainframe perhaps not use the IPP protocol
but the LPD protocol to send the print job so that
the CUPS server receives it via cups-lpd?
See "man cups-lpd" and /etc/xinetd.d/cups-lpd
what the actual options for your cups-lpd are.
Usually it is "-o document-format=application/octet-stream"
which forces autodetection of the print file format.


I think a better understanding how the CUPS filtering works
would help you a lot. Therefore you may have a look at
http://en.opensuse.org/SDB:CUPS_in_a_Nutshell
and in particular at least
http://en.opensuse.org/SDB:Using_Your_Own_Filters_to_Print_with_CUPS
"CUPS Filter System Background Information"


Kind Regards
Johannes Meixner
-- 
SUSE LINUX Products GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
AG Nuernberg, HRB 16746, GF: Markus Rex





More information about the cups mailing list