HP' s original intention was having these variants for each paper size
(you get this with the pure upstream code without applying the script):

1. Standard size, like "A4" giving smallest possible non-fullbleed margins. 
These sizes are the default sizes
2. Duplex sizes, like "A4.Duplex" having larger upper and lower margin to allow 
for printing suplex with duplex units of HP's inkjet printers. It is required 
to choose one of these paper sizes to be able to print duplex.
3. Full-bleed sizes, like A4.FB allowing borderless printing. To overcome 
tolerances in the paper size and printing mechanics some overspray (printing 
larger than the actual paper) Is done, meaning small image info loss at the 
borders (but the same happens if photos are printed borderless in a lab).

This was leading to an awkwardness about using duplex, as users had to
switch to a .Duplex paper size to be able to print duplex and the
CUPS/PPD mechanism did not allow for doing this automatically. So users
complained that duplex did not work and I came up with the script, which
worked great for many years.

The script changes paper size naming in an automated way:

A4 -> A4.SM (small margins)
A4.Duplex -> A4 (and now this being the standard paper size)

Problem is how to do this automatically, so that there are no patches
needed which need to be changed all the time when new printers get
added. The script needs to rename the paper sizes and skip printers
which do not support duplex and it has to also rename the UIConstraints
for duplex, and all that ideally without fully interpreting the .drv
file.

This got a challange when HP started having printer series with some
non-duplex and duplex printers and making use of nested {} to list the
non-duplex paper sizes once for all printers of the series and add the
duplex sizes only for the duplex printers. This makes the correct
renaming impossible for all the printers of the series.

Perhaps we need to remove the script to return to upstream reality with
the original awkwardness (perhaps this could be the SRU for Xenial) and
for a more sophisticated solution pre-build all PPDs, edit them with a
script to rename the paper sizes, and then either compress the PPDs with
pyppd for shipping or look whther CUPS has a tool to reverse-compile
PPDs to a .drv file, to generate the new .drv file this way.

WDYT?

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to hplip in Ubuntu.
https://bugs.launchpad.net/bugs/1568996

Title:
  Duplex printing does not work properly for HP printers

Status in hplip package in Ubuntu:
  Incomplete

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:~/ppd-testing$ ppdc -t hpcups.drv.upstream | grep FAIL
  roger@dragon:~/ppd-testing$

  Result a nice clean file.

  2. Take this file and run it through the script debian/local/make-
  duplex-page-sizes-default.sh that is run when this file is installed
  on a system. Then repeat the above test.

  roger@dragon:~/ppd-testing$ ppdc -t hpcups.drv.munged | grep FAIL

  --- Other FAILS removed

  hp-photosmart_6510_series.ppd: FAIL
        **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>>setpagedevice"
  and
  *PageSize A4/A4 AutoDuplex 210x297mm: "<</cupsInteger0 26/PageSize[595.44 
832.68]/ImagingBBox null>>setpagedevice"

  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/2016:17:59:54 +0100] [Job 288] argv[5]="InputSlot=Upper
  number-up=1 MediaType=Plain PageSize=Custom.A4 OutputMode=Normal
  ColorModel=KGray Duplex=DuplexNoTumble job-uuid=urn:uuid:4ef4d5ed-
  e47e-3817-4972-b4bfad8ef5d8 job-originating-host-name=localhost date-
  time-at-creation= date-time-at-processing= time-at-creation=1460393994
  time-at-processing=1460393994"

  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/2016:17:59:55 +0100] [Job 288] Unrecoverable error:
  rangecheck in setpagedevice

  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-driver-hpcups 3.15.7-0ubuntu4
  ProcVersionSignature: Ubuntu 4.2.0-35.40-generic 4.2.8-ckt5
  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-6510-series: 
dnssd://Photosmart%206510%20series%20%5BFDAD30%5D._pdl-datastream._tcp.local/?uuid=1c852a4d-b800-1f08-abcd-441ea1fdad30
  MachineType: System manufacturer System Product Name
  Papersize: a4
  PpdFiles: Error: command ['fgrep', '-H', '*NickName', 
'/etc/cups/ppd/HP-Photosmart-6510-series.ppd'] failed with exit code 2: grep: 
/etc/cups/ppd/HP-Photosmart-6510-series.ppd: Permission denied
  ProcEnviron:
   SHELL=/bin/bash
   PATH=(custom, no user)
   LANG=en_GB.UTF-8
   LANGUAGE=en_GB:en
   XDG_RUNTIME_DIR=<set>
  ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-4.2.0-35-generic 
root=/dev/mapper/ubuntu--vg-root ro quiet splash vt.handoff=7
  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.asset.tag: To Be Filled By O.E.M.
  dmi.board.name: P6T SE
  dmi.board.vendor: ASUSTeK Computer INC.
  dmi.board.version: Rev 1.xx
  dmi.chassis.asset.tag: Asset-1234567890
  dmi.chassis.type: 3
  dmi.chassis.vendor: Chassis Manufacture
  dmi.chassis.version: Chassis Version
  dmi.modalias: 
dmi:bvnAmericanMegatrendsInc.:bvr0403:bd05/19/2009:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKComputerINC.:rnP6TSE:rvrRev1.xx:cvnChassisManufacture:ct3:cvrChassisVersion:
  dmi.product.name: System Product Name
  dmi.product.version: System Version
  dmi.sys.vendor: System manufacturer

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/hplip/+bug/1568996/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to