After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 397225 - Printing options not totally efficient
Printing options not totally efficient
Status: RESOLVED DUPLICATE of bug 583429
Product: evince
Classification: Core
Component: printing
2.23.x
Other All
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
: 460267 550125 551066 567211 578721 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-01-16 12:04 UTC by David Prieto
Modified: 2009-05-23 15:25 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
a quick patch (880 bytes, patch)
2008-09-16 15:55 UTC, Marek Kašík
none Details | Review

Description David Prieto 2007-01-16 12:04:26 UTC
Please describe the problem:
I would like to raise attention on the way gnome apps are printing my
documents. However, I'm not sure what package I should file a bug
against or even if this is faulty or intended behaviour, so let me try
to explain it here:

I have this big, fat document like 300 pages long which I need to print.
Now I've never liked to waste paper, so I set evince to print 2 pages
for each paper sheet, and only odd pages. My plan was printing even
pages on the other side of the sheets.

This is how I expected the pages to be printed:

-1,2
-5,6
-9,10
-13,14

Then I'd turn the pages and print the remaining pages on the other side:

-1,2,3,4
-5,6,7,8
-9,10,11,12
-13,14,15,16

Did I make myself clear so far? Well, the actual result of printing only
odd pages was this:

-1,3
-5,7
-9,11
-13,15

So, had I printed even pages as well, these are the pages each actual
sheet would have shown:

-1,3,2,4
-5,7,6,8
-9,11,11,12
-13,15,14,16

Which is obviously wrong and makes the final printed document difficult
as hell to read. So my proposal is, when setting printing options like
even/odd or inverse order, could gnome base the final result on the
actual sheets instead of the document pages?


Steps to reproduce:
1. Print four pages using one sheet for two pages, and odd pages only.
2. Print the remaining, even pages.

Actual results:
The resulting sheet shows pages 1, 3, 2, 4. Totally wrong order.

Expected results:
Pages should be 1, 2, 3, 4.

Does this happen every time?
Every time.

Other information:
Comment 1 Matthias Clasen 2008-09-07 17:05:33 UTC
*** Bug 551066 has been marked as a duplicate of this bug. ***
Comment 2 Marek Kašík 2008-09-16 15:50:35 UTC
Hi,
this is evince bug. Evince uses printing widgets from GTK+ on its own way. Problem is that evince tries to generate list of pages to print itself. And this list is generated wrong. It prints even/odd pages not even/odd sheets. It is similar problem to the one in "Bug 455759 – Two copies and duplex printing don't work well together".
And this problem is also partially duplicated in "Bug 460267 – Printing two pages per sheet & only odd pages".

  Marek
Comment 3 Marek Kašík 2008-09-16 15:55:57 UTC
Created attachment 118828 [details] [review]
a quick patch

This is quick fix of this bug.
It leaves the sorting of pages to GTK+ printing stuff.
Comment 4 Alexander Kojevnikov 2009-04-28 05:34:16 UTC
*** Bug 550125 has been marked as a duplicate of this bug. ***
Comment 5 Alexander Kojevnikov 2009-04-28 05:45:23 UTC
*** Bug 567211 has been marked as a duplicate of this bug. ***
Comment 6 Alexander Kojevnikov 2009-04-28 05:51:41 UTC
*** Bug 460267 has been marked as a duplicate of this bug. ***
Comment 7 Alexander Kojevnikov 2009-04-28 05:52:12 UTC
Duplicate bug 460267 also contains a patch.
Comment 8 Alexander Kojevnikov 2009-04-28 06:14:18 UTC
*** Bug 578721 has been marked as a duplicate of this bug. ***
Comment 9 Bartek Kostrzewa 2009-05-19 12:26:50 UTC
I have a really simple fix for this. In export_print_page in ev-print-operation.c:

REPLACE: 

while ((export->page_set == GTK_PAGE_SET_EVEN && export->page % 2 == 0) ||
(export->page_set == GTK_PAGE_SET_ODD && export->page % 2 == 1));

WITH:

while((export->page_set == GTK_PAGE_SET_EVEN && (export->page / export->pages_per_sheet) % 2 == 0) ||
(export->page_set == GTK_PAGE_SET_ODD && (export->page / export->pages_per_sheet) % 2 == 1));

This way we check for even/odd sheets rather than pages in doing the pagination and nothing else has to be changed in the code.

ISSUES:
Is the integer division guaranteed portable?
Is pages_per_sheet guaranteed to be non-zero?
Will this interfere with duplex printing if the hardware supports native duplex?
Comment 10 Bartek Kostrzewa 2009-05-19 12:41:45 UTC
(In reply to comment #9)
> I have a really simple fix for this. In export_print_page in
> ev-print-operation.c:

argh, i meant "export_print_inc_page", of course
Comment 11 Carlos Garcia Campos 2009-05-23 15:25:45 UTC

*** This bug has been marked as a duplicate of 583429 ***