Bug 155695 - Multi-copy print jobs only print one copy
Summary: Multi-copy print jobs only print one copy
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 0.6
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
: 179545 186779 190283 199133 199506 201651 212217 213589 213861 219564 219995 228542 231767 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-01-13 23:44 UTC by Jonathan Thomas
Modified: 2013-07-30 19:51 UTC (History)
23 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
simple patch that hopefully fixes this (565 bytes, patch)
2009-12-22 22:54 UTC, Bartosz Brachaczek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Thomas 2008-01-13 23:44:44 UTC
Version:           0.6 (using KDE KDE 4.0.0)
Installed from:    Ubuntu Packages
Compiler:          gcc 
OS:                Linux

Printing multiple copies of PDFs with Okular won't work. Okular will always print one copy.
HP LaserJet 4L, I had no problems with KPDF in KDE 3.5.x.
Comment 1 Pino Toscano 2008-01-14 15:46:05 UTC
As in KDE 4.0 we are using QPrinter, it (in the 4.3 version) just returns 1 copy in case CUPS is found in the system.
So, we can do basically nothing about that, if not wait for Qt 4.4 and hoping it will suck less than now.

(Note: this affects printing of document of type PDF, PS, DjVu, DVI.)
Comment 2 Pino Toscano 2009-01-03 21:31:42 UTC
*** Bug 179545 has been marked as a duplicate of this bug. ***
Comment 3 Albert Astals Cid 2009-01-18 22:19:21 UTC
Has anyone tried if Qt 4.4 or Qt 4.5 fix this issue?
Comment 4 Adam Broschinski 2009-01-20 06:06:07 UTC
I'm running KDE 4.1.3 Qt 4.4.2 on gentoo and am having the same problem.
Comment 5 Adam Broschinski 2009-01-20 06:33:00 UTC
I think it has been fixed in Qt 4.5.
The relevant bug: 230372 - QPrinter::setNumCopies() misbehavior
Found on the Qt Task Tracker.
Comment 6 Pino Toscano 2009-03-10 15:15:16 UTC
*** Bug 186779 has been marked as a duplicate of this bug. ***
Comment 7 Pino Toscano 2009-04-24 15:30:24 UTC
*** Bug 190283 has been marked as a duplicate of this bug. ***
Comment 8 Julian G 2009-04-24 15:51:08 UTC
please reopen bug - it's not fixed in qt 4.5!

confirmed on fedora 10 x86 (kde 4.2.2, qt 4.5.0)
confirmed on gentoo x86 (kde 4.2.2, qt 4.5.0)
Comment 9 Pino Toscano 2009-04-24 15:58:32 UTC
(In reply to comment #8)
> please reopen bug - it's not fixed in qt 4.5!

Who said it is fixed?
What about *reading* my comment #1, instead of just doing a copy&paste of your comment from the other duplicate?
Thanks.
Comment 10 Julian G 2009-04-24 16:09:33 UTC
I *read* it, did you read mine too?

You said:
[..]
So, we can do basically nothing about that, if not wait for Qt 4.4 and hoping
it will suck less than now.
[..]

I told you that I'm running Qt 4.5 now and it is still not fixed!

comment #5 says:
[..]I think it has been fixed in Qt 4.5[..] <= no, it's not!
Comment 11 Pino Toscano 2009-04-24 16:15:37 UTC
(In reply to comment #10)
> I *read* it, did you read mine too?
> 
> You said:
> [..]
> So, we can do basically nothing about that, if not wait for Qt 4.4 and hoping
> it will suck less than now.

Note the "and hope" part, which means that we have (and had) still no idea about QtSoftware plans for helping about this situation.
My sentence does *not* imply a fix was plan.

> comment #5 says:
> [..]I think it has been fixed in Qt 4.5[..] <= no, it's not!

Comment #5 is purely irrelevant in the case of this bug. The resolution of that Qt bug has 0 relation with this.
Comment 12 Julian G 2009-04-24 16:43:08 UTC
http://www.qtsoftware.com/developer/task-tracker/index_html?method=entry&id=154711

Am I right that you should just call QPrinter for n times if using CUPS?
Comment 13 Pino Toscano 2009-04-24 17:38:49 UTC
(In reply to comment #12)
> Am I right that you should just call QPrinter for n times if using CUPS?

Sure, but given that direct QPrinter is NOT used for PDF files, that function is purely unuseful for us.
The workflow is the following: configure the QPrinter object, as the poppler library to produce a PostScript, and then manually invoking lpr-cups/lpr/lp trying to do an optimal job in replicating the options as set in the QPrinter object. We have no better solution than that, given 3rd party libraries we use for opening documents of various types don't even know what "QPrinter" is.
Then, http://doc.trolltech.com/4.5/qprinter.html#numCopies
Comment 14 Julian G 2009-04-24 23:34:48 UTC
Thank you Pino for your detailed answer. After I did a checkout of the okular code, I could understand it a little bit ;)

What needs to be done to get this fixed? 99% of KDE users just see that KDE4 refuses to print multiple times since one and a half year. What does QtSoftware say about this problem?

Would it be possible to have a "wrapper" class around QPrinter for handling the number of copies?
Comment 15 Pino Toscano 2009-05-20 11:41:06 UTC
*** Bug 193337 has been marked as a duplicate of this bug. ***
Comment 16 Nicolas Desmoulins 2009-05-20 14:18:27 UTC
Bug 193337 is about printing with a virtual pdf printer, with the mutipage option (several pages for each sheet). Not about printing several times the same document.

So Bug 193337 is not a duplicate of this bug.
Comment 17 Pino Toscano 2009-06-08 17:49:00 UTC
*** Bug 195684 has been marked as a duplicate of this bug. ***
Comment 18 Pino Toscano 2009-07-06 11:35:06 UTC
*** Bug 199133 has been marked as a duplicate of this bug. ***
Comment 19 Pino Toscano 2009-07-09 09:09:07 UTC
*** Bug 199506 has been marked as a duplicate of this bug. ***
Comment 20 Pino Toscano 2009-07-27 13:18:32 UTC
*** Bug 201651 has been marked as a duplicate of this bug. ***
Comment 21 EZMZSROZDCDO 2009-08-11 11:56:35 UTC
*** This bug has been confirmed by popular vote. ***
Comment 22 Julian G 2009-09-07 10:01:31 UTC
Here some news from my side:
Pino didn't respond on my mail nor does he seem to worry about this bug. I've contacted Qt Software and asked for help. Some minutes ago I got following mail:
The API we added for this is:

int QPrinter::actualNumCopies() const;

which returns the number you actually set on the printer object.
The change has been pushed to 4.6.

If Pino won't interrupt his hibernation I hope somebody else in the KDE community care about this fix.

@Pino: This is not a personal attack but the fact that you don't care about cooperative bug reporters (and about software you're in charge for) is weird.
Comment 23 Pino Toscano 2009-09-07 10:21:16 UTC
Dear Julian J.
after one month I've been busy with stuff and deadlines at work, I was going to empty the reply queue.
One of the replies was for your mail, but given the bullshit tone of the comment above, there will be none (apart from this one). Attacks like that will not be tolerated by me, and a week of no reply does NOT give you the right to insult me like that.

EOT.
Comment 24 Brad Hards 2009-09-07 12:01:35 UTC
Julian,

Someone else in the KDE community is scarcely likely to encourage personal attacks on developers  (since "didn't respond on my mail nor does he seem to worry about this bug" and "you don't care" are personal, despite your other words) by working on this issue.

The developers are volunteers - they work on bugs around many other things. Please be patient, and polite, and it will be better for everyone.

Thanks

Brad
Comment 25 Julian G 2009-09-07 13:02:20 UTC
@Brad:
I've already written a personal mail to Pino explaining how it looks through my eyes.

You're right, developers are volunteers - just like people who test software and try to give usefull bug reports. As you can see it's not my first comment on this issue. And as explained in my last comment I didn't just sit around and screamed 'it's not fixed'. But if mails and comments don't get answered, what else can I do? Not a single comment shows somebody working on this issue. I'm not in charge to command somebody to work on it but sometimes a constructive provocation seems to be the last option. (In my opinion it's been constructive because I spent time on this issue too and got something moving).
Comment 26 Pino Toscano 2009-11-07 20:19:46 UTC
*** Bug 213589 has been marked as a duplicate of this bug. ***
Comment 27 Sergei Ivanov 2009-11-08 01:52:38 UTC
Please excuse my ignorance, I am trying to understand why kate can print several copies and okular cannot. Is it because okular calls Qt printing dialog but then prints Postscript directly to the spooler, bypassing Qt? Are there other settings in that dialog that end up being ignored? For example, what about printer-specific options and job options?

If Qt does not allow for PostScript printing, doesn't this mean that Qt is not a right tool for this task? Also, some cups options are omitted in that Qt dialog. Could okular have an alternative printing command (called 'Expert Printing' or whatever), with an input box where one can just type in command line options for lp/lpr?
Comment 28 Bartosz Brachaczek 2009-11-08 12:00:19 UTC
No, Okular uses Qt to print PDFs, but Qt itself before 4.6.0 isn't able to print more than one copy using CUPS. If you are an "expert", you can compile Qt-4.6.0-beta, and then patch kdegraphics/okular/core/fileprinter.cpp to use actualNumCopies() in place of numCopies() in FilePrinter:copies() and compile Okular. That's how I did that and it works for me.
Comment 29 Pino Toscano 2009-11-09 17:46:04 UTC
*** Bug 213861 has been marked as a duplicate of this bug. ***
Comment 30 Kevin Kofler 2009-11-20 02:34:53 UTC
Reopening as this can now be fixed in 4.4, which requires Qt 4.6.
Comment 31 Ferdinand Gassauer 2009-12-09 16:55:18 UTC
IMHO would be helpful to mention this in release announcements (as it does not work in 4.3.4)
Comment 32 Pino Toscano 2009-12-21 16:15:44 UTC
*** Bug 219564 has been marked as a duplicate of this bug. ***
Comment 33 Bartosz Brachaczek 2009-12-22 20:25:19 UTC
Hi, are developers planning to fix it in KDE SC 4.4? It would be very nice!
Comment 34 Brad Hards 2009-12-22 20:56:12 UTC
Given the abuse that occurred, I think I have higher priorities.

Someone else may be working on it.
Comment 35 Bartosz Brachaczek 2009-12-22 22:53:27 UTC
OK, I understand. I have only one question: Isn't a simple patch replacing QPrinter::numCopies() with QPrinter::actualNumCopies() enough? I'm attaching one.
Comment 36 Bartosz Brachaczek 2009-12-22 22:54:49 UTC
Created attachment 39267 [details]
simple patch that hopefully fixes this

it just works for me
Comment 37 Albert Astals Cid 2009-12-22 23:27:23 UTC
John, feel like tackling this?
Comment 38 John Layt 2009-12-24 15:35:17 UTC
Been on my TODO list for 4.4 since I heard from Qt about the new api in 4.6, but have been having problems with okular crashing on opening pdfs.  Now tested with a dvi where the debug output shows the right output, but I'm away from home for Christmas so have no printer to confirm it works.  I will need someone with a real printer to confirm once committed.

Before I do commit however, I just want to comment on this thread which I hadn't seen before.  I find the criticism directed at Pino to be unacceptable, especially as it should have been directed at me, the author and maintainer of the Okular printing code and sometimes maintainer of KDE4 printing.  Before criticising you should get the facts and people involved correct.  

The solution implemented by Qt is also the wrong one, when I proposed the correct solution I was informed by Qt that this one was "as requested by KDE" and Qt would not change it.  Well, I don't recall "KDE" requesting this, I have seen no discussion on the relevant KDE mailing lists, so I'm not happy about the way this happened.
Comment 39 John Layt 2009-12-24 15:39:53 UTC
SVN commit 1065863 by jlayt:

Print correct number of copies using new Qt api

Add eror code if print to file fails

BUG: 155695


 M  +7 -3      fileprinter.cpp  
 M  +2 -0      fileprinter.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1065863
Comment 40 Pino Toscano 2009-12-24 20:47:25 UTC
*** Bug 219995 has been marked as a duplicate of this bug. ***
Comment 41 Pino Toscano 2010-02-25 23:03:53 UTC
*** Bug 228542 has been marked as a duplicate of this bug. ***
Comment 42 dmoyne 2010-03-03 10:26:08 UTC
As I do not know where to report this other issue linked to printer setting when printing from any KDE app I report it here :

- When your have a selection done in a document (example : a section of text, a rectangle in Kspread highligthed) when calling for a printing job normally the radio button section should logically be highligthed as a logical default.
Regards.
Comment 43 Kevin Kofler 2010-03-03 10:42:48 UTC
You should file a new bug report for that (use the "Report New Wish or Bug" link at the top of the page), it's a completely separate issue.
Comment 44 John Layt 2010-03-03 10:56:36 UTC
You would need to open a new bug to report it, any general printing bugs can be reported against kdelibs/print-dialog and we will triage them from there.

As it stands, this is something that each application needs to do when initialising the print dialog, they need to first enable the selection button in the print dialog, and then choose to have it as the default selection by setting the Print Range to Selection.

So you will need to open a bug against each application you find doing this and then it is up to the developers to decide if it is a sensible default (for Okular it isn't as the selection is the bookmarked page list, but in the future it chould be changed to selected text when it would make sense).

The other apps that enable Selection are:
  Kate
  KJots
  KSpread
  KDiff3
  Krusader

I haven't checked if they all have the bug.
Comment 45 Pino Toscano 2010-03-22 14:18:49 UTC
*** Bug 231767 has been marked as a duplicate of this bug. ***
Comment 46 Frank Reininghaus 2010-03-25 14:59:18 UTC
*** Bug 212217 has been marked as a duplicate of this bug. ***
Comment 47 rick 2013-07-30 19:51:03 UTC
I am attempting to print multiple copies of a single page of a document, but only one copy is printed.
I have tried both "current page" option and via page range.
I am using KDE 4.10.5 & Qt 4.8.4.  I only just recently attempted to print in this fashion, so I can't report on any earlier versions of KDE.