[cups-devel] Hack for PDF/driverless printing with Lexmark printersStephan

stephanwib at googlemail.com
Fri Feb 3 01:28:21 PST 2017


Lexmark printers of certain age (for example the CS748de) support
Airprint and IPP 2.0 and are able to print PDF just fine. The problem
is that they do not announce "application/pdf" in
document-format-supported, so the IPP everywhere PPD geneator does not
create a PDF filter entry in the PPD.

I am evaluating a hack by which I have replaced all filters with only
the PDF filter, effectively forcing the printer to operate in PDF
mode. The CUPS ipp backend receives "application/pdf" as
FINAL_CONTENT_TYPE and replaces it with "application/octet-stream"
after evaluating the Get-Printer-Attributes response from the printer
(which is exactly what is needed here). The only issue is that the IPP
backend does not send the media-col options in the job attributes for
the Print-Job call, leaving e.g. tray selection (media-source) not
working. I don´t see any obvious reason in the source code as to why
that is, so any hint would be very welcome. I am attaching the
relevant debug output below.

Thanks and regards,

Stephan


D [31/Jan/2017:13:58:07 +0000] [Job 623] Get-Printer-Attributes:
successful-ok-ignored-or-substituted-attributes
(successful-ok-ignored-or-substituted-attrib
utes)
D [31/Jan/2017:13:58:07 +0000] [Job 623] Automatically using \"gzip\"
compression.
D [31/Jan/2017:13:58:07 +0000] [Job 623] copies-supported=1-999
D [31/Jan/2017:13:58:07 +0000] [Job 623] document-format-supported (6 values)
D [31/Jan/2017:13:58:07 +0000] [Job 623] [0] = \"application/octet-stream\"
D [31/Jan/2017:13:58:07 +0000] [Job 623] [1] = \"image/urf\"
D [31/Jan/2017:13:58:07 +0000] [Job 623] [2] = \"image/jpeg\"
D [31/Jan/2017:13:58:07 +0000] [Job 623] [3] = \"application/postscript\"
D [31/Jan/2017:13:58:07 +0000] [Job 623] [4] = \"application/vnd.hp-PCL\"
D [31/Jan/2017:13:58:07 +0000] [Job 623] [5] = \"text/plain\"
D [31/Jan/2017:13:58:07 +0000] [Job 623] media-col-supported (7 values)
D [31/Jan/2017:13:58:07 +0000] [Job 623] [0] = \"media-size\"
D [31/Jan/2017:13:58:07 +0000] [Job 623] [1] = \"media-top-margin\"
D [31/Jan/2017:13:58:07 +0000] [Job 623] [2] = \"media-bottom-margin\"
D [31/Jan/2017:13:58:07 +0000] [Job 623] [3] = \"media-left-margin\"
D [31/Jan/2017:13:58:07 +0000] [Job 623] [4] = \"media-right-margin\"
D [31/Jan/2017:13:58:07 +0000] [Job 623] [5] = \"media-source\"
D [31/Jan/2017:13:58:07 +0000] [Job 623] [6] = \"media-type\"
D [31/Jan/2017:13:58:07 +0000] [Job 623] operations-supported (10 values)
D [31/Jan/2017:13:58:07 +0000] [Job 623] [0] = Print-Job
D [31/Jan/2017:13:58:07 +0000] [Job 623] [1] = Print-URI
D [31/Jan/2017:13:58:07 +0000] [Job 623] [2] = Validate-Job
D [31/Jan/2017:13:58:07 +0000] [Job 623] [3] = Cancel-Job
D [31/Jan/2017:13:58:07 +0000] [Job 623] [4] = Get-Job-Attributes
D [31/Jan/2017:13:58:07 +0000] [Job 623] [5] = Get-Jobs
D [31/Jan/2017:13:58:07 +0000] [Job 623] [6] = Get-Printer-Attributes
D [31/Jan/2017:13:58:07 +0000] [Job 623] [7] = Pause-Printer
D [31/Jan/2017:13:58:07 +0000] [Job 623] [8] = Resume-Printer
D [31/Jan/2017:13:58:07 +0000] [Job 623] [9] = Purge-Jobs
...
D [31/Jan/2017:13:58:07 +0000] [Job 623]
final_content_type=\"application/pdf\",
document_format=\"application/octet-stream\"
D [31/Jan/2017:13:58:07 +0000] [Job 623] Validate-Job IPP/2.0
D [31/Jan/2017:13:58:07 +0000] [Job 623] printer-uri=\"ipp://10.70.235.31:631/\"
D [31/Jan/2017:13:58:07 +0000] [Job 623] requesting-user-name=\"root\"
D [31/Jan/2017:13:58:07 +0000] [Job 623] job-name=\"623 - 2sides.pdf\"
D [31/Jan/2017:13:58:07 +0000] [Job 623]
document-format=\"application/octet-stream\"
D [31/Jan/2017:13:58:07 +0000] [Job 623] Adding standard IPP
operation/job attributes.
D [31/Jan/2017:13:58:07 +0000] [Job 623] IPP/2.0 Validate-Job #2
D [31/Jan/2017:13:58:07 +0000] [Job 623] ---- operation-attributes-tag ----
D [31/Jan/2017:13:58:07 +0000] [Job 623] attributes-charset charset utf-8
D [31/Jan/2017:13:58:07 +0000] [Job 623] attributes-natural-language
naturalLanguage en-us
D [31/Jan/2017:13:58:07 +0000] [Job 623] printer-uri uri ipp://10.70.235.31:631/
D [31/Jan/2017:13:58:07 +0000] [Job 623] requesting-user-name
nameWithoutLanguage root
D [31/Jan/2017:13:58:07 +0000] [Job 623] job-name nameWithoutLanguage
623 - 2sides.pdf
D [31/Jan/2017:13:58:07 +0000] [Job 623] document-format mimeMediaType
application/octet-stream
D [31/Jan/2017:13:58:07 +0000] [Job 623] ---- job-attributes-tag ----
D [31/Jan/2017:13:58:07 +0000] [Job 623] output-mode keyword monochrome
D [31/Jan/2017:13:58:07 +0000] [Job 623] print-quality enum normal
D [31/Jan/2017:13:58:07 +0000] [Job 623] sides keyword two-sided-short-edge
D [31/Jan/2017:13:58:07 +0000] [Job 623] ---- end-of-attributes-tag ----
D [31/Jan/2017:13:58:07 +0000] [Job 623] Validate-Job: successful-ok (OK)
D [31/Jan/2017:13:58:07 +0000] [Job 623] Print-Job IPP/2.0
D [31/Jan/2017:13:58:07 +0000] [Job 623] printer-uri=\"ipp://10.70.235.31:631/\"
D [31/Jan/2017:13:58:07 +0000] [Job 623] requesting-user-name=\"root\"
D [31/Jan/2017:13:58:07 +0000] [Job 623] job-name=\"623 - 2sides.pdf\"
D [31/Jan/2017:13:58:07 +0000] [Job 623]
document-format=\"application/octet-stream\"
D [31/Jan/2017:13:58:07 +0000] [Job 623] compression=\"gzip\"
D [31/Jan/2017:13:58:07 +0000] [Job 623] Adding standard IPP
operation/job attributes.
D [31/Jan/2017:13:58:07 +0000] [Job 623] IPP/2.0 Print-Job #4
D [31/Jan/2017:13:58:07 +0000] [Job 623] ---- operation-attributes-tag ----
D [31/Jan/2017:13:58:07 +0000] [Job 623] attributes-charset charset utf-8
D [31/Jan/2017:13:58:07 +0000] [Job 623] attributes-natural-language
naturalLanguage en-us
D [31/Jan/2017:13:58:07 +0000] [Job 623] printer-uri uri ipp://10.70.235.31:631/
D [31/Jan/2017:13:58:07 +0000] [Job 623] requesting-user-name
nameWithoutLanguage root
D [31/Jan/2017:13:58:07 +0000] [Job 623] job-name nameWithoutLanguage
623 - 2sides.pdf
D [31/Jan/2017:13:58:07 +0000] [Job 623] document-format mimeMediaType
application/octet-stream
D [31/Jan/2017:13:58:07 +0000] [Job 623] compression keyword gzip
D [31/Jan/2017:13:58:07 +0000] [Job 623] ---- job-attributes-tag ----
D [31/Jan/2017:13:58:07 +0000] [Job 623] output-mode keyword monochrome
D [31/Jan/2017:13:58:07 +0000] [Job 623] print-quality enum normal
D [31/Jan/2017:13:58:07 +0000] [Job 623] sides keyword two-sided-short-edge
D [31/Jan/2017:13:58:07 +0000] [Job 623] ---- end-of-attributes-tag ----
D [31/Jan/2017:13:58:07 +0000] [Job 623] Sending file using HTTP/1.1 chunking...
D [31/Jan/2017:13:58:07 +0000] [Job 623] Read 2112 bytes...
D [31/Jan/2017:13:58:07 +0000] [Job 623] Print-Job: successful-ok
(successful-ok)
D [31/Jan/2017:13:58:07 +0000] [Job 623] Print job accepted - job ID 402.
D [31/Jan/2017:13:58:07 +0000] [Job 623] STATE: +cups-waiting-for-job-completed


More information about the cups-devel mailing list