Duplex printing does not work properly for HP printers
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
hplip (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I am reporting this as a new bug because I want to avoid adding further to the mish mash of half fixed bugs that is duplex printing on hp printers via cups.
I will warn readers that this will sound like a bit of a rant. But these issues have been outstanding for years
1. Take the hpcups.drv driver information from the upstream part of the current source package and run it throught the cups ppd compiler in test mode, anbd filter the output for failures.
roger@dragon:
roger@dragon:
Result a nice clean file.
2. Take this file and run it through the script debian/
roger@dragon:
--- Other FAILS removed
hp-photosmart_
**FAIL** Multiple occurrences of option PageRegion choice name Card4x6.
**FAIL** Multiple occurrences of option PageRegion choice name Hagaki.
**FAIL** Multiple occurrences of option PageRegion choice name Card5x8.
**FAIL** Multiple occurrences of option PageRegion choice name Oufuku.
**FAIL** Multiple occurrences of option PageRegion choice name Executive.
**FAIL** Multiple occurrences of option PageRegion choice name A4.
**FAIL** Multiple occurrences of option PageSize choice name Card4x6.
**FAIL** Multiple occurrences of option PageSize choice name Hagaki.
**FAIL** Multiple occurrences of option PageSize choice name Card5x8.
**FAIL** Multiple occurrences of option PageSize choice name Oufuku.
**FAIL** Multiple occurrences of option PageSize choice name Executive.
**FAIL** Multiple occurrences of option PageSize choice name A4.
--Other FAILS removed
I have removed the many other printer types that fail for clarity. It is a feature of the cups ppdc compiler that if you do not specify the -t option it will blithely go on and produce the compiled ppds errors and all. I personally think that this is a bug and the compiler should refuse to produce erroneous ppds, but putting that to one side. Taking A4 as an exmaple the hp6510 ppd file now has two definitions for PageSize A4.
*PageSize A4/A4 210x297mm: "<</cupsInteger0 26/PageSize[595.44 841.68]/ImagingBBox null>>setpagede
and
*PageSize A4/A4 AutoDuplex 210x297mm: "<</cupsInteger0 26/PageSize[595.44 832.68]/ImagingBBox null>>setpagede
Same name but different page dimensions. Only the first one will ever be seen by the cups system.
3. This above often does not matter when printing from the command line. Because PageSize options are not often specified. However, taking as an example a gnome desktop application such as Evince printing a pdf using the gtk+ print options with duplex printing selected. In this case a PageSize option will be passed to Cups and it will look like this.
D [11/Apr/
So the PageSize is "Custom.A4". The "Custom" bit gets stripped off so what is passed down for matching is "A4" which matches the first occurrence of A4. Depending on what other defaults are set in the pdd it might print something, but it will most likely be clipped. In the case of the 6510 it results in this.
D [11/Apr/
Of course the above line only appears in the error_log if you have debugging turned on. So the job just appears to stuck in the print queue for no reason at all. This is probably another bug.
The work around. This has been mentioned many times in various bug reports. You need page sizes, page regions, imageable areas, and paper dimensions with names ending in .Duplex in your ppd. Rename the duplicate which has the biggest bottom margin, hopefully this is the one with AutoDuplex in the descriptive text. It is probably best to make these entries default as well. You might make the corresponding changes in the drv file if you wish. That will save you having to reapply them every time the ppd file is regenerated.
I realise that I have broken just about every rule in the "bug laws". I offer no excuse:-)
Comments please.
Roger
ProblemType: Bug
DistroRelease: Ubuntu 15.10
Package: printer-
ProcVersionSign
Uname: Linux 4.2.0-35-generic x86_64
ApportVersion: 2.19.1-0ubuntu5
Architecture: amd64
CurrentDesktop: Unity
Date: Mon Apr 11 18:10:41 2016
InstallationDate: Installed on 2014-05-04 (707 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Release amd64 (20140417)
Lpstat: device for HP-Photosmart-
MachineType: System manufacturer System Product Name
Papersize: a4
PpdFiles: Error: command ['fgrep', '-H', '*NickName', '/etc/cups/
ProcEnviron:
SHELL=/bin/bash
PATH=(custom, no user)
LANG=en_GB.UTF-8
LANGUAGE=en_GB:en
XDG_RUNTIME_
ProcKernelCmdLine: BOOT_IMAGE=
SourcePackage: hplip
UpgradeStatus: Upgraded to wily on 2015-10-24 (170 days ago)
dmi.bios.date: 05/19/2009
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 0403
dmi.board.
dmi.board.name: P6T SE
dmi.board.vendor: ASUSTeK Computer INC.
dmi.board.version: Rev 1.xx
dmi.chassis.
dmi.chassis.type: 3
dmi.chassis.vendor: Chassis Manufacture
dmi.chassis.
dmi.modalias: dmi:bvnAmerican
dmi.product.name: System Product Name
dmi.product.
dmi.sys.vendor: System manufacturer
description: | updated |
Changed in hplip (Ubuntu): | |
status: | New → Fix Committed |
I have changed the original bug text slightly. After spending some time grepping the cups and gtk source to find what was adding the .Duplex suffix I realised it was probably coming from my own changes and I had copied the wrong bit of log into the bug. The problem is still that it is the second A4 occurrence that has the correct bounding box for duplex printing and of this is never found.