首页 文章

杯子拒绝使用'filter error'打印pdf文件,因为 Headers 过长

提问于
浏览
3

我的系统是Debian 3.16.7 . 今天,我使用杯子向我的Kyocera fs-1041打印机渲染了一份打印作业(一篇论文命名为“单词和短语的分布式表达及其组合性”) . 但是,打印机拒绝在杯子的浏览器控制面板上打印'Filter failed'的错误消息 .

在我的/ var / cups / error_log里面说:

E [18/Sep/2016:12:36:27 +0200] [Job 225] Job stopped due to filter errors; please consult the error_log file for details.
    D [18/Sep/2016:12:36:27 +0200] [Job 225] The following messages were recorded from 12:36:21 PM to 12:36:27 PM
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Adding start banner page "none".
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Adding end banner page "none".
    D [18/Sep/2016:12:36:27 +0200] [Job 225] File of type application/pdf queued by "root".
    D [18/Sep/2016:12:36:27 +0200] [Job 225] hold_until=0
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Queued on "Kyocera_FS-1041" by "root".
    D [18/Sep/2016:12:36:27 +0200] [Job 225] time-at-processing=1474194981
    D [18/Sep/2016:12:36:27 +0200] [Job 225] 3 filters for job:
    D [18/Sep/2016:12:36:27 +0200] [Job 225] pdftopdf (application/pdf to application/vnd.cups-pdf, cost 66)
    D [18/Sep/2016:12:36:27 +0200] [Job 225] gstoraster (application/vnd.cups-pdf to application/vnd.cups-raster, cost 99)
    D [18/Sep/2016:12:36:27 +0200] [Job 225] /usr/lib/cups/filter/rastertokpsl (application/vnd.cups-raster to printer/Kyocera_FS-1041, cost 0)
    D [18/Sep/2016:12:36:27 +0200] [Job 225] job-sheets=none,none
    D [18/Sep/2016:12:36:27 +0200] [Job 225] argv[0]="Kyocera_FS-1041"
    D [18/Sep/2016:12:36:27 +0200] [Job 225] argv[1]="225"
    D [18/Sep/2016:12:36:27 +0200] [Job 225] argv[2]="root"
    D [18/Sep/2016:12:36:27 +0200] [Job 225] argv[3]="Distributed Representations of Words and Phrases and their Compositionality - 5021-distributed-representations-of-words-and-phrases-and-their-compositionality.pdf"
    D [18/Sep/2016:12:36:27 +0200] [Job 225] argv[4]="1"
    D [18/Sep/2016:12:36:27 +0200] [Job 225] argv[5]="CaBrightness=0 PageSize=Letter MediaType=PrnDef EngineSpeed=Off CaContrast=0 number-up=1 job-uuid=urn:uuid:a19e56db-80b7-307d-4359-b8a1c32c90f5 job-originating-host-name=localhost time-at-creation=1474194981 time-at-processing=1474194981"
    D [18/Sep/2016:12:36:27 +0200] [Job 225] argv[6]="/var/spool/cups/d00225-001"
    ...
    <!-envps>
    ...
    D [18/Sep/2016:12:36:27 +0200] [Job 225] envp[29]="FINAL_CONTENT_TYPE=application/vnd.cups-raster"
    D [18/Sep/2016:12:36:27 +0200] [Job 225] envp[30]="AUTH_I****"
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Started filter /usr/lib/cups/filter/pdftopdf (PID 4664)
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Started filter /usr/lib/cups/filter/gstoraster (PID 4665)
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Started filter /usr/lib/cups/filter/rastertokpsl (PID 4666)
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Started backend /usr/lib/cups/backend/usb (PID 4667)
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Loading USB quirks from "/usr/share/cups/usb".
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Loaded 113 quirks.
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Printing on printer with URI: usb://Kyocera/FS-1041?serial=NZF2X06371
    D [18/Sep/2016:12:36:27 +0200] [Job 225] *** buffer overflow detected ***: Kyocera_FS-1041 terminated
    D [18/Sep/2016:12:36:27 +0200] [Job 225] ======= Backtrace: =========
    D [18/Sep/2016:12:36:27 +0200] [Job 225] /lib/x86_64-linux-gnu/libc.so.6(+0x731af)[0x7f525aaf11af]
    D [18/Sep/2016:12:36:27 +0200] [Job 225] /lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7f525ab76cf7]
    D [18/Sep/2016:12:36:27 +0200] [Job 225] /lib/x86_64-linux-gnu/libc.so.6(+0xf6f10)[0x7f525ab74f10]
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Kyocera_FS-1041[0x406c87]
    D [18/Sep/2016:12:36:27 +0200] [Job 225] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7f525aa9fb45]
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Kyocera_FS-1041[0x40799d]
    D [18/Sep/2016:12:36:27 +0200] [Job 225] ======= Memory map: ========
    D [18/Sep/2016:12:36:27 +0200] [Job 225] 00400000-00430000 r-xp 00000000 08:04 3541254                            /usr/lib/cups/filter/rastertokpsl
    ...
    <!-Memory map->
    ...
    D [18/Sep/2016:12:36:27 +0200] [Job 225] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
    D [18/Sep/2016:12:36:27 +0200] [Job 225] PID 4666 (/usr/lib/cups/filter/rastertokpsl) crashed on signal 6.
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Hint: Try setting the LogLevel to "debug" to find out more.
    D [18/Sep/2016:12:36:27 +0200] [Job 225] libusb_get_device_list=8
    D [18/Sep/2016:12:36:27 +0200] [Job 225] STATE: +connecting-to-device
    D [18/Sep/2016:12:36:27 +0200] [Job 225] STATE: -connecting-to-device
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Printer found with device ID: MFG:Kyocera;MDL:FS-1041;CLS:PRINTER;SN:NZF2X06371;CID:KY_KPSL_MonoPersonal; Device URI: usb://Kyocera/FS-1041?serial=NZF2X06371
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Device protocol: 2
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Sending data to printer.
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Sent 0 bytes...
    D [18/Sep/2016:12:36:27 +0200] [Job 225] PID 4664 (/usr/lib/cups/filter/pdftopdf) exited with no errors.
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Color Manager: Calibration Mode/Off
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Calling FindDeviceById(cups-Kyocera_FS-1041)
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Found device /org/freedesktop/ColorManager/devices/cups_Kyocera_FS_1041
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Calling org.freedesktop.ColorManager.Device.Get(ProfilingInhibitors)
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Calling FindDeviceById(cups-Kyocera_FS-1041)
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Found device /org/freedesktop/ColorManager/devices/cups_Kyocera_FS_1041
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Calling GetProfileForQualifiers(Gray.PrnDef.600dpi...)
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Found profile /org/freedesktop/ColorManager/profiles/Kyocera_FS_1041_Gray__
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Calling org.freedesktop.ColorManager.Profile.Get(Filename)
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Use profile filename: ''
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Color Manager: ICC Profile: 
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Ghostscript command line: /usr/bin/gs -dQUIET -dPARANOIDSAFER -dNOPAUSE -dBATCH -dNOINTERPOLATE -sDEVICE=cups -sstdout=%stderr -sOutputFile=%stdout -r600x600 -dDEVICEWIDTHPOINTS=612 -dDEVICEHEIGHTPOINTS=792 -dcupsBitsPerColor=8 -dcupsColorOrder=0 -dcupsColorSpace=3 -dcupsCompression=1 -scupsPageSizeName=Letter -I/usr/share/cups/fonts -c '<</.HWMargins[12.000000 8.000000 12.000000 16.000000] /Margins[0 0]>>setpagedevice' -f -_
    D [18/Sep/2016:12:36:27 +0200] [Job 225] envp[0]="CUPS_CACHEDIR=/var/cache/cups"
    ...
    <!-envps->
    ...
    D [18/Sep/2016:12:36:27 +0200] [Job 225] envp[30]="AUTH_INFO_REQUIRED=none"
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Start rendering...
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Processing page 1...
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Processing page 2...
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Waiting for read thread to exit...
    D [18/Sep/2016:12:36:27 +0200] [Job 225] PID 4667 (/usr/lib/cups/backend/usb) exited with no errors.
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Processing page 3...
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Processing page 4...
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Processing page 5...
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Processing page 6...
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Processing page 7...
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Processing page 8...
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Processing page 9...
    D [18/Sep/2016:12:36:27 +0200] [Job 225] Rendering completed
    D [18/Sep/2016:12:36:27 +0200] [Job 225] PID 4665 (/usr/lib/cups/filter/gstoraster) exited with no errors.
    D [18/Sep/2016:12:36:27 +0200] [Job 225] End of messages

已经搜索了几个问题和问题,如thisthis等等,我仍然无法找到摆脱这个问题的方法 .

奇怪的是,现在仍然可以打印由LibreOffice等创建的杯子测试页面或doc文件 .

所以我想这可能是由pdf文件本身引起的,并开始破解格式化文件,最后意识到太长的 /Title 字段会导致这个问题 . 将此字段从"Distributed Representations of Words and Phrases and their Compositionality"更改为"test"后,它确实有效!

但是仍然不知道为什么这个长 /Title 字段会导致过滤错误,有人可以建议一个答案或给我发一个关于过滤器如何用pdf文件表现的链接?

1 回答

  • 1

    要修复它,您需要打开打印机intext编辑器的PPD文件 . 找到一行 *cupsFilter: "application/vnd.cups-raster 0 /usr/lib/cups/filter/rastertokpsl" 并将 rastertokpsl 更改为 rastertokpsl-fixed . 之后,保存并打开终端 . 在终端输入 sudo nano /usr/lib/cups/filter/rastertokpsl-fixed 并按Enter键 .

    将此内容粘贴到:

    #!/bin/bash
    jobname=$(echo $3 | egrep -o '[[:alnum:]]' | tr -d '\n' | tail -c 20)
    path=/usr/lib/cups/filter
    $path/rastertokpsl "$1" "$2" "$jobname" "$4" "$5"
    

    然后按Ctrl O.现在,您可以使用此PPD在“设置”中设置打印机 .

相关问题