Duplex printing does not work

Bug #1485207 reported by Frederick Thomssen
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qpdfview
Invalid
Undecided
Unassigned

Bug Description

Version 0.4.12

When selecting Duplex Printing "Long Side" or "Short Side", this option is ignored and instead printing is performed without duplex printing. When opening the printing dialogue again, "None" is pre-selected.

Revision history for this message
Adam Reichold (adamreichold) wrote :

Hello Frederick,

thank you for taking the time to report this. Could you also provide the distribution and its version you're are using? Also the source of the qpdfview package if it is not from the distribution's repositories itself might be helpful.

My first guess as to the cause of this is some mismatch between the handling of CUPS options between Qt and qpdfview and maybe the printer driver. Could you also add a screenshot of your print dialog with the relevant setting show and maybe for comparison with the (extended) printer properties? Thank you! (For example sometimes there is a driver-specific option that will override the generic option.)

Best regards, Adam.

P.S.: You can check if qpdfview at least stored your selection and tried to apply it to the printer before handing it to Qt's print dialog by looking for the key "printDialog/duplex" in "qpdfview.conf" which should be 2 or 3 for long and short side respectively.

Changed in qpdfview:
status: New → Incomplete
Revision history for this message
Fabio Rossi (rossi-f) wrote :

I have the same problem, in the sense that the duplex printing is not working properly. I'm using CUPS 2.0.3 with a Color LaserJet 5500 installed as a smb printer. The default CUPS options are:

 job-sheets=none, none media=iso_a4_210x297mm sides=one-sided

so the duplexing is disabled by default and left to the application choice. I'm able to change the printing settings in qpdfview and they are correctly saved in the qpdfview.conf:

[printDialog]
collateCopies=false
pageOrder=0
orientation=0
colorMode=0
duplex=2
fitToPage=true
pageSet=0
numberUp=0
numberUpLayout=3

When printing, the following options are passed to CUPS:

noCollate ColorModel=Gray Duplex=DuplexNoTumble finishings=3 fit-to-page InputSlot=Upper nolandscape number-up=1 number-up-layout=lrtb outputorder=normal page-ranges=1-2 sides=two-sided-long-edge job-uuid=urn:uuid:6d0ff776-5105-32fd-4179-9885452e2033 job-originating-host-name=localhost time-at-creation=1453374111 time-at-processing=1453374111

so the duplexing option are present (Duplex=DuplexNoTumble sides=two-sided-long-edge) but the effective printing is one side. Then I have tried acroread and he is using the following options:

ColorModel=RGB Duplex=DuplexNoTumble finishings=3 InputSlot=Default number-up=1 OptionDuplex PageRegion=A4 PageSize=A4 Resolution=600dpi job-uuid=urn:uuid:087d524d-e4e5-3b69-6c44-d805b9ca5d6c job-originating-host-name=localhost time-at-creation=1453374810 time-at-processing=1453374810

but here the page is correctly printed on two sides.

I have created a patch (here attached) removing from qpdfview the sides option to CUPS and then I get finally the two sides printing. So it seems there is a problem with the "sides=two-sided-long-edge" option and CUPS and/or the printer driver.

Revision history for this message
Fabio Rossi (rossi-f) wrote :

I forgot to say I'm using qpdfview 0.4.16

Revision history for this message
Fabio Rossi (rossi-f) wrote :
Revision history for this message
Adam Reichold (adamreichold) wrote :

Hello Fabio,

thank you for following up on this! Sadly, I cannot verify your change myself since I currently have no access to a duplex-capable printer, but I trust that this indeed enables duplex printing for you. But I am not yet sure what to do about it: Does Qt properly map the long-side/short-side distinction after removing qpdfview's code to do that? Also, this should theoretically be independent of the printer driver as the manual page of lp [1] suggests that this is a "common" option. Maybe we are marshalling it wrong. Could you check the job options when you print a file using lp on the command line with -o sides=two-sided-long-edge?

Best regards, Adam.

Revision history for this message
Adam Reichold (adamreichold) wrote :

Sorry, forgot the link:

[1] http://linux.die.net/man/1/lp-cups

Changed in qpdfview:
status: Incomplete → Confirmed
Revision history for this message
Fabio Rossi (rossi-f) wrote :

I have just tried with lp, I get the same behaviour as with qpdfview, here were the options passed

Duplex=DuplexNoTumble finishings=3 InputSlot=Upper number-up=1 sides=two-sided-long-edge job-uuid=urn:uuid:e3ebf888-0f74-3ca2-6e5a-734961e930d5 job-originating-host-name=localhost time-at-creation=1453481474 time-at-processing=1453481474

To be honest I'm confused right now. If I use the CUPS web interface I get the following default options:

job-sheets=none, none media=iso_a4_210x297mm sides=one-sided

but I have noticed the Duplex=DuplexNoTumble option inserted every time. If I query the printing options with lpoptions I get

copies=1 device-uri=smb://sincro-print/it-a3color Duplex=DuplexNoTumble finishings=3 InputSlot=Upper job-cancel-after=10800 job-hold-until=no-hold job-priority=50 job-sheets=none,none marker-change-time=0 number-up=1 printer-commands=AutoConfigure,Clean,PrintSelfTestPage printer-info='Color LaserJet 5500' printer-is-accepting-jobs=true printer-is-shared=true printer-location printer-make-and-model='HP Color LaserJet Series PCL 6 CUPS' printer-state=3 printer-state-change-time=1453482465 printer-state-reasons=none printer-type=8532060 printer-uri-supported=ipp://localhost:631/printers/color

Here are the printer specific ones only:

PageSize/Media Size: Letter Legal Executive Tabloid A3 *A4 A5 B5 EnvISOB5 Env10 EnvC5 EnvDL EnvMonarch
InputSlot/Media Source: Default Auto MultiPurpose *Upper Lower LargeCapacity Manual Envelope
ColorModel/Output Mode: *RGB Gray
Resolution/Output Resolution: 150dpi 300dpi *600dpi 1200dpi
Duplex/Double-Sided Printing: None *DuplexNoTumble DuplexTumble
OptionDuplex/Duplexer: *True False

In the case I use lp without specifying any option, I get duplex printing so it seems that the default option is indeed duplexing enabled. So I don't understand why the extra option sides=two-sided-long-edge disables duplexing :-(

Revision history for this message
Adam Reichold (adamreichold) wrote :

Hello Fabio,

not really a solution, but I did notice that "Duplex=NoTumble" does probably not enable duplex printing but only specifies the sorting. I suspect that "OptionDuplex" ("True" or "False" with "True" being the default) is what actually triggers duplex printing. I also noticed that "OptionDuplex" seems to have been removed in the final print job options whenever "sides" was passed additionally. Maybe you could therefore try if passing "OptionDuplex" explicitly helps, e.g. print using "lp -o sides=sides=two-sided-long-edge -o OptionDuplex"?

If that does not help either, I think we should consider either reporting a bug against the printer driver (since it seems rather driver-specific) or against the filter chain which on Linux is usually provided by the cups-filters [1] project. What do you think?

Best regards, Adam.

[1] http://www.linuxfoundation.org/collaborate/workgroups/openprinting/cups-filters

Revision history for this message
Fabio Rossi (rossi-f) wrote :

Hi Adam,
the point is that the printing option management is a mess from the point of view of clients using the CUPS API. Anyway I have finally solved the issue by changing PPD for the printer using the postscript interpreter while the old one was using the PCL interpreter (so a different chain of filters was used). I suspect there was a problem with one of the filters (I suspect gstopxl). Now I'm using the driver from the hplip package and it works without problems.

Revision history for this message
Adam Reichold (adamreichold) wrote :

Closing this for now since there was no feedback from the original reporter, the second reporter found the root cause in a filter chain issue and I was finally able to test this myself an duplex capable device without no apparent problems.

Changed in qpdfview:
status: Confirmed → Invalid
Revision history for this message
Philipp Spitzer (philipp-spitzer-priv) wrote :

I came across this bug report because I have a similar problem with my Brother MFC-J5320DW printer: qpdfview (0.4.12) does not print duplex (pages come after each other) although it works with some other programs.

FYI, I summarize here what I found out:
A lpr command line like

lpr -o sides=two-sided-long-edge myfile.pdf

has the same behavior as qpdfview (duplex does _not_ work and pages come out separately). What does work is the following command line

lpr -o BRDuplex=DuplexNoTumble myfile.pdf

It seems that my printer only uses the duplex option BRDuplex with the possible values "DuplexNoTumble" (=long side binding), "DuplexTumble" (=short side binding) and "None" (no duplex).

Additionally, some web sites say that "PlainDuplex" media type has to be selected for duplex to work (instead of "Plain" media type) but in my experiments that didn't make any difference.

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

Other bug subscribers

Remote bug watches

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