Pdf

cups-pdf 通過 cups-lpd 創建沒有內容但列印機配置的 PDF 文件

  • June 29, 2017

我正在使用 cups-pdf 通過 lpd (埠 515)進行列印 到目前為止工作正常,但是所有 pdf 文件都是使用其列印機配置的內容創建的。PDF 文件包括以下內容:

Media Limits: 0.00 x 0.00 to 8.26 x 11.69 inches
Job ID: PDFPrinter003-197
Driver: CUPS-PDF.PPD
Driver Version: 1.1
Description: SAP2PDF
Driver Version: SAP2PDF
Make and Model: Generic CUPS-PDF Printer (no options)
Printer: PDFPrinter003
Created at: Tue Jun 27 12:42:12 2017
Printed at: Tue Jun 27 12:42:12 2017

我在日誌文件中找不到任何有趣的東西。在 /var/log/cups/cups-pdf-PDFPrinter003_log 中,關於 PDF 創建的一切都很好。

在 /var/log/cups/error_log 中如下:

W [27/Jun/2017:13:00:11 +0200] CreateProfile failed: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files
W [27/Jun/2017:13:00:11 +0200] CreateProfile failed: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files
W [27/Jun/2017:13:00:11 +0200] CreateDevice failed: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files
W [27/Jun/2017:13:00:38 +0200] CreateProfile failed: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files
W [27/Jun/2017:13:00:38 +0200] CreateProfile failed: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files
W [27/Jun/2017:13:00:38 +0200] CreateDevice failed: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files
W [27/Jun/2017:13:00:46 +0200] Unexpected 'document-format' operation attribute in a Create-Job request.
W [27/Jun/2017:13:00:46 +0200] Unexpected 'document-name' operation attribute in a Create-Job request.

我用於 lpd 列印的 xinetd.conf 部分如下:

service printer
   {
       socket_type = stream
       protocol = tcp
       wait = no
       user = lp
       server = /usr/lib/cups/daemon/cups-lpd
   }

請詢問是否缺少某些東西。

你有想法嗎?

Greetz Eldo.O

解決了:

這是lpd中的一個“功能”。預設情況下,lpd 列印一個“橫幅”並創建 2 個假離線文件。第一個假離線文件已列印,但它只是橫幅,第二個文件被 cups-pdf 忽略。

我不得不禁用 xinetd.conf 中的橫幅

server_args = -o document-format=application/octet-stream -o job-sheets=none,none

這解決了我的問題。

引用自:https://unix.stackexchange.com/questions/373649