hpcups duplex fails with number-up

Bug #484928 reported by Tim Waugh on 2009-11-18
This bug affects 13 people
Affects Status Importance Assigned to Milestone

Bug Description

With the hpcups driver, duplexing fails when printing with e.g. number-up=2. This is because the setpagedevice bits for setting the Duplex boolean are put in the PageSetup section, which is too late when number-up processing is in effect.

It should go in AnySetup.

Ideally the drv file would just have "Duplex Yes" or whatever is needed -- is it possible to do that and still have the duplex page size contraints work?

Original bug report:

Related branches

Tim Waugh (twaugh) wrote :

Here's a patch against 3.9.10.

Tim Waugh (twaugh) wrote :

This patch also exposes another problem: the hpcups.drv driver incorrectly uses these settings:

Attribute "cupsBackSide" "" "Rotated"
Attribute "cupsFlipDuplex" "" "True"

They cause the reverse side of duplexed pages to be horizontally flipped. Those lines should be removed altogether.

David Suffield (david-suffield) wrote :

Tim, thank-you for your patch. We applied the patch to the tip.

But, the following attributes are required for inkjets and work correctly for 1-up and 2-up duplex printing.

Attribute "cupsBackSide" "" "Rotated"
Attribute "cupsFlipDuplex" "" "True"

These attributes are not required for laserjets.

Tim Waugh (twaugh) wrote :

All I can tell you is that I am testing with an inkjet (an HP DeskJet 990C), and I needed to remove those options in order to have un-mirrored 1-up duplexing -- see comment #2.

Perhaps you are testing with the duplex PPD snippet being added to the wrong place in the PostScript file (see comment #1)?

David Suffield (david-suffield) wrote :

Ok, what version of ghostscript or distro are you using?

We saw this kind of mirror image problem with GPL ghostscript 8.61 (Ubuntu 8.04), but it worked ok on ghostscript 8.63 and 8.64.

We were testing on a DJ990 also.

Tim Waugh (twaugh) wrote :

GhostScript 8.70 on Fedora 12.

David Suffield (david-suffield) wrote :

Ok, we tested auto duplex on Fedora 12 using a DJ990. Yes I see the mirror image problem with ghostscript 8.70.

Removing the cupsBackSide and cupsFlipDuplex attributes fixes the backpage mirror image problem, but not the backpage page orientation. The backpage is not rotated 180 degrees.

This seems to be Fedora specific, because on Ubuntu 9.10, Ghostscript 8.70 duplex printing 1-up and 2-up print ok with both attributes set in the PPD. No backpage mirror image problem and no orientation problem.

Tim Waugh (twaugh) wrote :

OK, I also see the 180 degree rotation. :-(

As for Ubuntu 9.10: I believe they don't see the original 'PageSetup'/'AnySetup' bug due to rasterizating from PDF instead of PS. The filter chain for a PostScript file there is: pstopdf | pdftopdf | pdftoraster | hpcups. On Fedora 12 it is : pstops | pstoraster | hpcups.

With a "standard" set-up, and no modifications from upstream, i.e. ghostscript-8.70, cups-1.4.2, and hplip-3.9.8, you will certainly see the problem. Running the PS-based filter chain manually on Ubuntu shows it:

export PPD=/etc/cups/ppd/HP-Deskjet-990c.ppd

/usr/lib/cups/filter/pstops 1 tim '' 1 'Duplex=DuplexTumble PageSize=A4Duplex number-up=2' 4pages.ps > pstops.ps

/usr/lib/cups/filter/pstoraster 1 tim 1 'Duplex=DuplexTumble PageSize=A4Duplex number-up=2' pstops.ps > pstoraster.rast

lp -dhp-deskjet-990c -o 'Duplex=DuplexTumble PageSize=A4Duplex number-up=2' pstoraster.rast

Till Kamppeter (till-kamppeter) wrote :

Reported Ghostscript upstream bug:


I have fixed the Ghostscript bug in the last days. Please take Ghostscript from the Subversion repository, with this version the back sides are OK, also with N-up. Make sure that the "Duplex" option is in AnySetup and not in PageSetup for N-up and leave the

*cupsBackSide: "Rotated"
*cupsFlipDuplex: True

lines in the PPD. Do not remove them. Now everything should work correctly with both PDF-based (Debian, Ubuntu) and PostScript-based (Fedora/Red Hat) printing workflows.

I have applied the Ghostscript fix also to Lucid's Ghostscript now. So an up-to-date Lucid will also work correctly from the Ghostscript side.

anup (osta6161) wrote :

I pulled out the latest GS from subversion and tested on Fedora 12 on HP officejet 6500 printer model. Problem still exists. :(



Frank Jalics (frank-1grn5) wrote :

I also have a HP Officejet 6500 E709n, and run Fedora 12, and also have the mirror image problem with the auto duplex. I don't know enough to help find/fix the problem, but would be willing to try things.

Tim Waugh (twaugh) wrote :

Frank: apply the updates, and if it still fails, please file a bug in Bugzilla:

My first fix in Ghostscript was still broke,. so make sure you get rev 10631 or newer from the Ghostscript SVN (Jan 22, 2010). Ghostscript 8.70.dfsg.1-0ubuntu5 for Ubuntu Lucid contains this fix, too.

Bruno DARCET (bruno-darcet) wrote :

I've the same problem on Debian-lenny / HPLIP 3.9.12 / HP Office Pro 8000

What's the issue ?

Bruno DARCET (bruno-darcet) wrote :

I've the same problem on Debian-lenny / HPLIP 3.9.12 / HP Office Pro 8000

What's the issue ?

i just install GS from SVN (8.70) but problem is still here.
what is wrong ?

Mubeen Jukaku (mubeen-jukaku) wrote :

Installed Ghostscript 8.71 on Fedora 11. With auto duplex, back pages are printed correctly.

When I select duplex printing with long edge the backside is printed in mirrored
I'm using HP Officejet Pro 8000 / SuSE 11.2 32Bit / hplip-3.9.12 / CUPS 1.3.11 / ghostscript 8.70

Andreas Hölscher, the fix is in Ghostscript 8.71, you need to update Ghostscript.

Tim Waugh (twaugh) wrote :

FWIW I reverted this fix in the Fedora package due to this regression:

..which can cause a lot of wasted ink and paper.

Tim Waugh, I have fixed the problems with my fix for Ghostscript, please take the cups/gdevcups.c of current SVN state of Ghostscript for Fedora.

safttuete (safttuete) wrote :

On Gentoo, with HPLIP 3.10.2-r1, cups 1.3.11-r1 and ghostscript-gpl 8.71-r2 the bug is still there.

What are the requirements to get this fixed. Just ghostscript-8.71 or is the original patch still needed?

Tim Waugh (twaugh) wrote :

The requirements are:

* hplip-3.10.2 (or apply the above patch to older versions)
* ghostscript with gdevcups.c from SVN 10890

There is no released ghostscript version containing all necessary fixes:

All versions of Fedora have the necessary packages in the updates-testing repository, and they will shortly be pushed as updates.

Changed in hplip:
status: New → Fix Released
Josh Burghandy (kid1000002000) wrote :

Having this same problem when doing duplex scanning

Hi Josh Burghandy,

   Can you please explain what problem are you getting while duplex scanning? This bug is related to duplex printing. Please provide the output of hp-check.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.