Bug 8017 - Printing from Adobe Flash plugin through cups fails
Summary: Printing from Adobe Flash plugin through cups fails
Status: RESOLVED OLD
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 2
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL: http://www.senteacher.org/Worksheet/8...
Whiteboard:
Keywords: PATCH, Triaged
Depends on:
Blocks:
 
Reported: 2012-11-08 16:05 CET by Derek Jennings
Modified: 2013-11-23 16:16 CET (History)
3 users (show)

See Also:
Source RPM: cups-1.5.2-5.1.mga2
CVE:
Status comment:


Attachments

Description Derek Jennings 2012-11-08 16:05:06 CET
Description of problem:
When using Firefox (or other browser) on a site that uses Flash to print documents, the print job always fails with an error when printing through Cups to many printers.

The problem has been identified since 2009 as being due to the Flash plugin creating malformed Postscript documents. Adobe has been aware of the bug since 2009 and has not fixed it. The cups developers do not regard it as their problem to fix.

Fortunately it is very easy to create a custom cups filter to recognise and fix malformed print jobs as described in this cups bug report
http://www.cups.org/str.php?L3281

I have implemented this in Mageia 2 and Mageia3 Alpha2 and it works OK :-)
Files affected are :-

Create a file /etc/cups/mime.types

#Custom CUPS mime types
#    broken-postcript mime type is to allow cups to identify postscript generated by Adobe Flash plugin with bad DSC
application/broken-postscript string(0,"%!PS-Adobe-3.0") + !contains(0,4096,"%%Pages:")


Create a file /etc/cups/mime.convs

# convert broken postscript to good postscript using the filter psfix
application/broken-postscript  application/postscript 10     psfix


Create a file /usr/lib/cups/filter/psfix

#!/bin/sh
# This is a custom CUPS filter to repair broken postscript documents 
# created by Adobe Flash plugin
echo '%!'; exec tail -n +2  "${6-"-"}"

Do not forget to make this file executable

chmod +x /usr/lib/cups/filter/psfix


A test site to use is 
http://www.senteacher.org/Worksheet/8/Scanning.xhtml

click on 'Print sheet' to start the print job.


A Redhat bug report on the same issue is here
https://bugzilla.redhat.com/show_bug.cgi?id=773765


Before the custom filter was implemented  the error log shows:-

E [07/Nov/2012:22:47:02 +0000] [Job 90] Job stopped due to filter errors; please consult the error_log file for details.
D [07/Nov/2012:22:47:02 +0000] [Job 90] The following messages were recorded from 22:47:01 to 22:47:02
D [07/Nov/2012:22:47:02 +0000] [Job 90] Adding start banner page "none".
D [07/Nov/2012:22:47:02 +0000] [Job 90] Queued on "Officejet-Pro-L7400" by "derek".
D [07/Nov/2012:22:47:02 +0000] [Job 90] Auto-typing file...
D [07/Nov/2012:22:47:02 +0000] [Job 90] Request file type is application/postscript.
D [07/Nov/2012:22:47:02 +0000] [Job 90] File of type application/postscript queued by "derek".
D [07/Nov/2012:22:47:02 +0000] [Job 90] Adding end banner page "none".
D [07/Nov/2012:22:47:02 +0000] [Job 90] job-sheets=none,none
D [07/Nov/2012:22:47:02 +0000] [Job 90] argv[0]="Officejet-Pro-L7400"
D [07/Nov/2012:22:47:02 +0000] [Job 90] argv[1]="90"
D [07/Nov/2012:22:47:02 +0000] [Job 90] argv[2]="derek"
D [07/Nov/2012:22:47:02 +0000] [Job 90] argv[3]="(stdin)"
D [07/Nov/2012:22:47:02 +0000] [Job 90] argv[4]="1"
D [07/Nov/2012:22:47:02 +0000] [Job 90] argv[5]="finishings=3 fitplot number-up=1 job-uuid=urn:uuid:67324cf9-31c9-30d1-74ad-c8f5c69dc0c8 job-originating-host-name=localhost time-at-creation=1352328421 time-at-processing=1352328421 AP_D_InputSlot="
D [07/Nov/2012:22:47:02 +0000] [Job 90] argv[6]="/var/spool/cups/d00090-001"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[0]="CUPS_CACHEDIR=/var/cache/cups"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[1]="CUPS_DATADIR=/usr/share/cups"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[2]="CUPS_DOCROOT=/usr/share/cups/doc"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[3]="CUPS_FONTPATH=/usr/share/cups/fonts"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[4]="CUPS_REQUESTROOT=/var/spool/cups"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[5]="CUPS_SERVERBIN=/usr/lib/cups"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[6]="CUPS_SERVERROOT=/etc/cups"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[7]="CUPS_STATEDIR=/var/run/cups"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[8]="HOME=/var/spool/cups/tmp"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[9]="PATH=/usr/lib/cups/filter:/usr/lib64/cups/filter:/usr/bin:/usr/sbin:/bin:/usr/bin"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[10]="SERVER_ADMIN=root@Derek.localdomain"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[11]="SOFTWARE=CUPS/1.5.2"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[12]="TMPDIR=/var/spool/cups/tmp"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[13]="USER=root"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[14]="CUPS_SERVER=/var/run/cups/cups.sock"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[15]="CUPS_ENCRYPTION=IfRequested"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[16]="IPP_PORT=631"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[17]="CHARSET=utf-8"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[18]="LANG=en_GB.UTF-8"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[19]="PPD=/etc/cups/ppd/Officejet-Pro-L7400.ppd"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[20]="RIP_MAX_CACHE=128m"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[21]="CONTENT_TYPE=application/postscript"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[22]="DEVICE_URI=hp:/usb/Officejet_Pro_L7400?serial=MY82S1509P"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[23]="PRINTER_INFO=HP Officejet Pro L7400"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[24]="PRINTER_LOCATION=localhost"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[25]="PRINTER=Officejet-Pro-L7400"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[26]="PRINTER_STATE_REASONS=none"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[27]="CUPS_FILETYPE=document"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[28]="FINAL_CONTENT_TYPE=printer/Officejet-Pro-L7400"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[29]="AUTH_I****"
D [07/Nov/2012:22:47:02 +0000] [Job 90] Started filter /usr/lib/cups/filter/pstops (PID 18560)
D [07/Nov/2012:22:47:02 +0000] [Job 90] Started filter /usr/lib/cups/filter/gstoraster (PID 18561)
D [07/Nov/2012:22:47:02 +0000] [Job 90] Started filter /usr/lib/cups/filter/hpcups (PID 18562)
D [07/Nov/2012:22:47:02 +0000] [Job 90] Started backend /usr/lib/cups/backend/hp (PID 18563)
D [07/Nov/2012:22:47:02 +0000] [Job 90] Page = 595x842; 9,9 to 586,833
D [07/Nov/2012:22:47:02 +0000] [Job 90] slow_collate=0, slow_duplex=0, slow_order=0
D [07/Nov/2012:22:47:02 +0000] [Job 90] Before copy_comments - %!PS-Adobe-3.0
D [07/Nov/2012:22:47:02 +0000] [Job 90] %!PS-Adobe-3.0
D [07/Nov/2012:22:47:02 +0000] [Job 90] %%BoundingBox: 0 0 612 792
D [07/Nov/2012:22:47:02 +0000] [Job 90] There wasn't a %%Pages: comment in the header.
D [07/Nov/2012:22:47:02 +0000] [Job 90] Before copy_prolog - 0 792 translate
D [07/Nov/2012:22:47:02 +0000] [Job 90] Before copy_setup - DEBUG: Before page loop - DEBUG: Wrote 0 pages...
D [07/Nov/2012:22:47:02 +0000] [Job 90] PPD uses qualifier 'RGB.Automatic.'
D [07/Nov/2012:22:47:02 +0000] [Job 90] Calling FindDeviceById(Officejet-Pro-L7400)
D [07/Nov/2012:22:47:02 +0000] [Job 90] Failed to send: org.freedesktop.ColorManager.Failed:device id 'Officejet-Pro-L7400' does not exists
D [07/Nov/2012:22:47:02 +0000] [Job 90] Failed to get profile filename!
D [07/Nov/2012:22:47:02 +0000] [Job 90] no profiles specified in PPD
D [07/Nov/2012:22:47:02 +0000] [Job 90] Set job-printer-state-message to "no profiles specified in PPD", current level=INFO
D [07/Nov/2012:22:47:02 +0000] [Job 90] Ghostscript command line: /usr/bin/gs -dQUIET -dPARANOIDSAFER -dNOPAUSE -dBATCH -dNOINTERPOLATE -dNOMEDIAATTRS -sDEVICE=cups -sstdout=%stderr -sOutputFile=%stdout -I/usr/share/cups/fonts -c -f -_
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[0]="CUPS_CACHEDIR=/var/cache/cups"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[1]="CUPS_DATADIR=/usr/share/cups"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[2]="CUPS_DOCROOT=/usr/share/cups/doc"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[3]="CUPS_FONTPATH=/usr/share/cups/fonts"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[4]="CUPS_REQUESTROOT=/var/spool/cups"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[5]="CUPS_SERVERBIN=/usr/lib/cups"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[6]="CUPS_SERVERROOT=/etc/cups"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[7]="CUPS_STATEDIR=/var/run/cups"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[8]="HOME=/var/spool/cups/tmp"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[9]="PATH=/usr/lib/cups/filter:/usr/lib64/cups/filter:/usr/bin:/usr/sbin:/bin:/usr/bin"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[10]="SERVER_ADMIN=root@Derek.localdomain"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[11]="SOFTWARE=CUPS/1.5.2"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[12]="TMPDIR=/var/spool/cups/tmp"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[13]="USER=root"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[14]="CUPS_SERVER=/var/run/cups/cups.sock"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[15]="CUPS_ENCRYPTION=IfRequested"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[16]="IPP_PORT=631"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[17]="CHARSET=utf-8"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[18]="LANG=en_GB.UTF-8"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[19]="PPD=/etc/cups/ppd/Officejet-Pro-L7400.ppd"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[20]="RIP_MAX_CACHE=128m"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[21]="CONTENT_TYPE=application/postscript"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[22]="DEVICE_URI=hp:/usb/Officejet_Pro_L7400?serial=MY82S1509P"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[23]="PRINTER_INFO=HP Officejet Pro L7400"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[24]="PRINTER_LOCATION=localhost"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[25]="PRINTER=Officejet-Pro-L7400"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[26]="PRINTER_STATE_REASONS=none"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[27]="CUPS_FILETYPE=document"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[28]="FINAL_CONTENT_TYPE=printer/Officejet-Pro-L7400"
D [07/Nov/2012:22:47:02 +0000] [Job 90] envp[29]="AUTH_INFO_REQUIRED=none"
D [07/Nov/2012:22:47:02 +0000] [Job 90] STATE: -marker-supply-low-warning
D [07/Nov/2012:22:47:02 +0000] [Job 90] Start rendering...
D [07/Nov/2012:22:47:02 +0000] [Job 90] Set job-printer-state-message to "Start rendering...", current level=INFO
D [07/Nov/2012:22:47:02 +0000] [Job 90] Processing page 1...
D [07/Nov/2012:22:47:02 +0000] [Job 90] Set job-printer-state-message to "Processing page 1...", current level=INFO
D [07/Nov/2012:22:47:02 +0000] [Job 90] prnt/hpcups/HPCupsFilter.cpp 253: ERROR: Unsupported resolution
D [07/Nov/2012:22:47:02 +0000] [Job 90] prnt/backend/hp.c 833: ERROR: null print job total=0
D [07/Nov/2012:22:47:02 +0000] [Job 90] End of messages
D [07/Nov/2012:22:47:02 +0000] [Job 90] printer-state=3(idle)
D [07/Nov/2012:22:47:02 +0000] [Job 90] printer-state-message="/usr/lib/cups/filter/hpcups failed"
D [07/Nov/2012:22:47:02 +0000] [Job 90] printer-state-reasons=none
Comment 1 Manuel Hiebel 2012-11-08 16:26:02 CET
no maintainer and a lot of commiters so adding them which could be interested

Keywords: (none) => PATCH
CC: (none) => cjw, doktor5000

Samuel Verschelde 2013-08-29 15:15:30 CEST

Keywords: (none) => Triaged
CC: (none) => stormi

Comment 2 Manuel Hiebel 2013-10-22 12:21:13 CEST
This message is a reminder that Mageia 2 is nearing its end of life.
Approximately one month from now Mageia will stop maintaining and issuing updates for Mageia 2. At that time this bug will be closed as WONTFIX (EOL) if it remains open with a Mageia 'version' of '2'.

Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Mageia version prior to Mageia 2's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Mageia 2 is end of life.  If you would still like to see this bug fixed and are able to reproduce it against a later version of Mageia, you are encouraged to click on "Version" and change it against that version of Mageia.

Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Mageia release includes newer upstream software that fixes bugs or makes them obsolete.

-- 
The Mageia Bugsquad
Comment 3 Manuel Hiebel 2013-11-23 16:16:41 CET
Mageia 2 changed to end-of-life (EOL) status on ''22 November''. Mageia 2 is no
longer maintained, which means that it will not receive any further security or
bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of Mageia
please feel free to click on "Version" change it against that version of Mageia
and reopen this bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

--
The Mageia Bugsquad

Status: NEW => RESOLVED
Resolution: (none) => OLD


Note You need to log in before you can comment on or make changes to this bug.