Bug 175276

Summary: Duplex printing not working
Product: [Applications] okular Reporter: Shishir <shishir.py>
Component: generalAssignee: Okular developers <okular-devel>
Status: RESOLVED UPSTREAM    
Severity: normal CC: aacid, jeremy, jlayt, niburu1, polet82, rdieter, rmj, shoalcreek5, vigleik.angeltveit
Priority: NOR    
Version: 0.7.2   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Screenshot

Description Shishir 2008-11-16 10:07:32 UTC
Version:           0.7.2 (using KDE 4.1.2)
Compiler:          CC 
OS:                Linux
Installed from:    Ubuntu Packages

I wanted to print on both sides of a sheet so enabled duplex printing on long side. Only one side of the sheet is printed.

How to reproduce:
1. Try to print a 2 page document on both sides by enabling duplex printing (any option).

Expected Behaviour: It must print on both sides of the sheet.
Comment 1 Brad Hards 2008-11-16 10:42:01 UTC
Can you try with a 3 (or more) page document? Is the problem that the reverse side is not printed, or that the last page is not printed?
Comment 2 Shishir 2008-11-16 11:58:30 UTC
(In reply to comment #1)
> Can you try with a 3 (or more) page document? Is the problem that the reverse
> side is not printed, or that the last page is not printed?
> 

I tried it with a 10 page document. It does not print on both sides.So, it is not the problem of not printing the last page but, not printing on both sides. 
FYI - I am using HP Laserjet 3390.
Comment 3 Albert Astals Cid 2008-11-16 22:32:34 UTC
It's a pdf file?

We should probably read DuplexMode QPrinter::duplex () const and pass it to poppler, the problem is that as far as i know poppler/Postscript only supports duplex or not, and DuplexMode has QPrinter::DuplexLongSide and QPrinter::DuplexShortSide

It seems DuplexShortSide is Tumble duplex, but poppler does not support it, so we'd need to implement it.

Sucks without a duplex printer for testing :/


Comment 4 Shishir 2008-11-17 07:15:48 UTC
As Albert has pointed out, the file I was printing from was a PDF file. I just tried with the file of ODT format and duplex printing does not work with this either.
Comment 5 Pino Toscano 2008-11-17 13:20:06 UTC
(In reply to comment #3)
> We should probably read DuplexMode QPrinter::duplex () const and pass it to
> poppler,

Not objecting to this, better than nothing of course.
Just noting that this solution would be PDF-specific :/
Comment 6 Albert Astals Cid 2008-11-17 22:15:13 UTC
Strange ODT does not work since we use QPrinter directly for that no the hack we have for pdf files, or we do use it here too?
Comment 7 Jeremy Sanders 2008-12-15 13:07:09 UTC
It seems okular also doesn't get the default values for things like duplex from cups (using the ppd file). kpdf picked up all the cups driver settings and set these as the default. okular doesn't show these settings. evince appears to work correctly.

This is with KDE-4.1.3 under Fedora 10.
Comment 8 Shishir 2008-12-17 05:03:22 UTC
Hi
I am not a developer so, I cannot fix the problem. But I wanted to know if none of you are planning the fix it?
Comment 9 Albert Astals Cid 2008-12-17 22:53:50 UTC
If you send us your printer it will be easier to fix the problem.

Now seriously, John has been working on printing he might have a better answer.
Comment 10 John Layt 2008-12-17 23:19:43 UTC
OK, apologies if these questions seem a bit dumb, but I like to make sure I'm clear on exactly what the problem is and where it is.

1) Can you describe exactly what does get printed?  Do you get the right number of sheets of paper output with the pages in the right place, or does it just print as if in single page mode? i.e. a 10 page document is printed on 5 sheets of paper with just the odd pages printed, or do you get 10 sheets with all the pages printed, or ???
2) Does this problem happen in other KDE apps like konqueror or kwrite?
3) Does this problem happen in non-KDE/Qt apps like Firefox or OpenOffice?

It's a bit hard to duplicate this one without a duplex printer, I will try track one down.  I'm wondering if the duplex fix I made last week would resolve this?  If the problem is missing pages I don't think so.  If the problem is that it's reverting to single-sided then it might do.
Comment 11 Shishir 2008-12-18 05:23:25 UTC
Hi John

To clarify the problem:
1)I printed a 10 page pdf document. The duplex printing did not work. It printed all the 10 pages on 10 separate sheets as if, the duplex printing was not set.
2)I have not tried duplex printing with other KDE applications.
3)The problem does not occur with Evince and Firefox. I do not know what happens with 'Open Office'.
Comment 12 Jeremy Sanders 2008-12-18 10:43:33 UTC
Also to clarify the cups issue:
 * In kwrite you get a list of printer options in the advanced print tab
 * In okular you just get a blank grey pane in the advanced print tab
Should I open up a separate bug?
Comment 13 John Layt 2008-12-20 10:30:09 UTC
@Shishir: Can you please test with another KDE application, konqueror would be good.  I need to be able to tell if it is a problem with our special printing code in Okular that I need to fix, or if its a wider problem with the normal Qt printing system that we need to ask Qt to fix.

@Jeremy: This is an existing known bug https://bugs.kde.org/show_bug.cgi?id=177360
Comment 14 Shishir 2009-01-15 07:37:11 UTC
Created attachment 30264 [details]
Screenshot
Comment 15 Shishir 2009-01-15 07:42:23 UTC
Comment on attachment 30264 [details]
Screenshot

Hi
I have just tried to tried duplex printing from Konqueror as John requested. The printer does not print on both sides. Also, I noticed there are two places in Konqueror which tell you about the Duplex printing (one place is where you set for printing on both sides while the general settings says duplex is Off)
Comment 16 vigleik.angeltveit 2009-05-21 22:26:35 UTC
I am experiencing this bug too, on okular 0.8.3, kde 4.2.3.
Comment 17 Brice Hunt 2009-10-27 23:45:09 UTC
This is interesting. I do not experience this bug. Instead, I experience the opposite, that the printer always prints in duplex mode except when using non-KDE apps (see bug #195107). The good thing about linux is that I can download a different more stable app that doesn't use KDE libraries and still do my critical work while keeping the app with unstable behavior for testing purposes.
Comment 18 Dmitriy 2009-11-27 07:05:31 UTC
I think this bug is closely related to "okular sends A4 to the printer as paper size" bug here:
https://bugs.kde.org/show_bug.cgi?id=185296

and it sounds more like a QT problem I've seen mentioned here: "the printing dialog does not query CUPS":
http://bugreports.qt.nokia.com/browse/QTBUG-6239

the workaround so far is to change the property to something else, then to change it back to what you want.
Comment 19 vigleik.angeltveit 2009-11-27 14:43:46 UTC
Actually I think duplex printing is working, you just have to specify
it manually every time. (Every other program I have ever tried to
print from prints duplex automatically.)

On Fri, Nov 27, 2009 at 12:05 AM, Dmitriy <polet82@list.ru> wrote:
> https://bugs.kde.org/show_bug.cgi?id=175276
>
>
> Dmitriy <polet82@list.ru> changed:
>
>           What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                 CC|                            |polet82@list.ru
>
>
>
>
> --- Comment #18 from Dmitriy <polet82 list ru>  2009-11-27 07:05:31 ---
> I think this bug is closely related to "okular sends A4 to the printer as paper
> size" bug here:
> https://bugs.kde.org/show_bug.cgi?id=185296
>
> and it sounds more like a QT problem I've seen mentioned here: "the printing
> dialog does not query CUPS":
> http://bugreports.qt.nokia.com/browse/QTBUG-6239
>
> the workaround so far is to change the property to something else, then to
> change it back to what you want.
>
> --
> Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are a voter for the bug.
> You are on the CC list for the bug.
>
Comment 20 Shishir 2009-11-27 16:17:34 UTC
Hi

I have tested the duplex printing today and it is working fine.
Comment 21 Dmitriy 2009-11-29 06:59:29 UTC
My CUPS is set to use duplex by default. However, the printing dialog does not look at them. The duplex is off by default there and I have to change it manually every time.
Firefox, have no such problem.
I still think that it is a problem of QT, not Okular, just want to have a confirmation from the developers.
Comment 22 Albert Astals Cid 2009-11-29 15:20:49 UTC
The obvious question is: Does "duplex is off by default there and I have to change it manually every time" happen only in Okular or also in Qt programs like assistant-qt4 (you might have to install additional packages to have assistant-qt4, it might be called assistant only in some distros)?
Comment 23 Dmitriy 2009-11-30 22:32:25 UTC
I've tried teaqt editor. Same story as in Okular and KWrite. Changing between duplex and non-duplex printers does not update the printing dialog.
Qt: 4.5.3, KDE: 4.3.2, Mandriva 2010

Just tried Debian machine with KDE 3.5.x and QT 3.x.x, everything works like charm. Once the printer is changed, the default printer's settings get into the printing dialog.

I guess it is a QT problem and if the KDE developers could double check that and forward it to QT guys to fix, that would be great, as it ruins not only the duplex printing, but A4 vs letter default pages sizes bug I've mentioned before.

In case you want to check it yourself, setup 2 printers, say HP 8150. One with duplex by default, the other is not and play with them in the printing dialog.

Can't try qt4-assistant as it segfaults for some reason (oh, why these things won't just work here, KDE 3.5 next door runs perfectly :-/
Comment 24 Albert Astals Cid 2009-12-01 01:24:30 UTC
Works for me on Kubuntu 9.10 (Basically same versions you mention)

By works for me i mean that i have
  PSC_1600 with sides=two-sided-long-edge
and
  HP_PSC_1600_series with sides=one-sided

In the okular print dialog if i select PSC_1600 and go to Properties -> Advanced i see Double-Sided Printing -> Long Edge (Standard) while if i selec and go to Properties -> Advanced i see Double-Sided Printing -> Off

Is that what you are doing?
Comment 25 Dmitriy 2009-12-01 05:01:52 UTC
No, I'm talking about Options / Duplex Printing

I don't have that machine nearby, by I'm talking about that: http://www.layt.net/john/system/files/images/qt44_printdialog_options.png
(image is not mine, but similar)

My printer setup is similar to yours. Doesn't matter which printer I choose, Duplex Printing is always None by default. On the other machine with KDE 3.5.x and QT 3.x.x, the default is Long Side for the duplex printer.
So, my Print Dialog simply doesn't query the printer default properties.

Do you have the same QT 4.5.3 as I do?
Comment 26 Roderick Johnstone 2009-12-01 11:20:30 UTC
Some further info...hope this doesnt confuse things too much.

I'm using Fedora 12, which has kde 4.3.3 and qt 4.5.3, on x86_64. Printing uses cups to a server running on another system running cups 1.3.7

In kate and okular I see the same behaviour as each other.

Print properties/advanced shows all the correct settings for the print queue (as far as I can tell).

What is wrong is that print options/options shows Duplex printing set to None when 2-Sided Printing was set to Long Edge Binding in options/advanced.

What actually happens when I print is that both applications obey properties/advanced and print 2-sided. If I change properties/advanced 2-sided printing to None then the job prints single sided. However, in both cases options/options/Duplex printing is set to none. So, you can't control the duplex-ness using options/options/Duplex Printing.

So its the options/options/Duplex Printing that doesnt work for me.

Hope this is clear...its a bit complicated to explain!
Comment 27 Albert Astals Cid 2009-12-01 22:37:03 UTC
Not our bug

http://bugreports.qt.nokia.com/browse/QTBUG-6433

If you want, register in their bug tracker and vote/watch the issue.
Comment 28 Dmitriy 2009-12-02 02:40:54 UTC
Albert,
I think this bug have the same root, take a look
http://bugs.kde.org/show_bug.cgi?id=185296

it drives people nuts way more than the duplex one.
Comment 29 niburu1 2010-11-09 17:18:25 UTC
This bugs shows to be resolved here, but on my Kubuntu 10.10 install (Okular version 0.11.2) duplex printing doesn't always work (most of the time it doesn't) when I use Options -> Options -> Actions (tab) -> Duplex Printing. I haven't yet tried Properties -> Advanced (tab) -> 2-sided printing (value=ON) but from what I gather from others, it should work. I haven't tried printing multiple copies.