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 460267 - Printing two pages per sheet & only odd pages
Printing two pages per sheet & only odd pages
Status: RESOLVED DUPLICATE of bug 397225
Product: evince
Classification: Core
Component: printing
0.8.x
Other All
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-07-25 15:00 UTC by Matthias Kuhn
Modified: 2009-05-22 16:42 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
Fix odd/even printing (4.37 KB, patch)
2008-03-19 23:01 UTC, Eugen Dedu
none Details | Review
Solves all the issues (except reverse?) with dialog printing (8.09 KB, patch)
2008-03-27 21:50 UTC, Eugen Dedu
none Details | Review

Description Matthias Kuhn 2007-07-25 15:00:22 UTC
Please describe the problem:
When printing two pages per sheet and only the odd pages, I expect evince to print the first two pages on the first sheet, then pages number 5 and 6 on the following sheet and so on, to be able to put the same paper in the printer again and print the missing pages (the 'even' ones) on the back of these sheets.

Steps to reproduce:
1. Open for example http://developer.gnome.org/doc/guides/programming-guidelines/programming-guidelines.ps
2. Press Ctrl+P to start the printing dialogue
3. Go to "Page Setup"
4. Pages per sheet: 2
5. Only print: Odd sheets
6. Print


Actual results:
It prints pages number 1 and 3 on the first sheet, page number 5 and 7 on the second sheet...

Expected results:
See above...

Does this happen every time?
I think so...

Other information:
Comment 1 Eugen Dedu 2008-03-19 23:01:30 UTC
Created attachment 107653 [details] [review]
Fix odd/even printing

Hi,

This patch fixes the odd/even printing.  Odd/even refers to printed pages, not document pages (imagine several pages per sheet).

There are also a few cosmetic changes for better comprehension of code.

I have reviewed it, but of course you can do it too.

Cheers,
Eugen Dedu
Comment 2 Eugen Dedu 2008-03-23 16:16:52 UTC
Hi,

I have a few questions about this bug:

1. When printing non-collate N copies of a document in *duplex* mode, does it print 1/1 2/2 3/3 ... or does it ignore the duplex mode and prints 1/blank 1/blank 2/blank 2/blank etc.?  Or does it print 1/2 1/2 3/4 3/4 etc.?  I think the last is the good one.  The patch should be modified then.  In fact, what is non-collate good for?  But the reverse?

2. Why collate is by default unchecked?  I imagine one prints collate almost all of the time.

3. There is still a bug in this patch, namely in collate and duplex mode each copy should start another full page (to avoid 1/2 ... N-3/N-2 N/1, 2/3...)

4. I wonder if there is a function in glib or so which treats all the printing functionality, because it seems to me that every program which prints needs the same code for the print dialog (n copies, reverse, duplex etc.)  For ex. I would love to make the printing function ev_job_print_run in ev-jobs.c generic, to be used by every program.

Regards,
Eugen Dedu
Comment 3 Eugen Dedu 2008-03-26 20:59:27 UTC
I would like to fix points 1, 2 and 3 from my previous comment.  Do you think it's worth (i.e. will the patch be checked in)?

Cheers,
Eugen Dedu
Comment 4 Nickolay V. Shmyrev 2008-03-26 21:54:40 UTC
Eugen, thanks for the patch. It just needs some time to jump into problem :)
Comment 5 Eugen Dedu 2008-03-27 21:50:20 UTC
Created attachment 108145 [details] [review]
Solves all the issues (except reverse?) with dialog printing

Hi,

Ok, I created a new patch which replaces the previous one.  The patch also solves points 1 (now it prints 1/2 1/2 3/4 3/4 etc. in duplex mode with 2 copies) and 3 (a new copy starts on a new leaf in duplex mode).  I think this fixes all the problems with the printing dialog (well... except reverse, see below).  Sorry, I thought it would be simpler to code and to explain.

Some comments:
- I needed to write the code to read the state of the 'duplex' checkbox in the printing dialog
- what is this line useful for?
    fc.duplex = FALSE;
  I modified it to:
    fc.duplex = job->duplex;
- I had to write twice the same code (page generation, first for recto, second for verso).  I know it is ugly, but it seems to be a bit easier to understand than creating a for loop, saving the page variable etc.
- reverse might not be optimal in some cases (it seems that it should start with a blank page if odd number of pages).  We can fix this later if really needed, once we know exactly what reverse is useful for.
- finally, odd/even in duplex mode has no sense IMO, I suppose that the user has inadvertently set the duplex mode and I reset it.

Let me know what do you think.

Cheers,
Eugen Dedu
Comment 6 Alexander Kojevnikov 2009-04-28 05:51:41 UTC
Eugen, this is a duplicate of bug 397225 which also includes a patch. I'm going to close this one, could you please check the other bug and its patch?

Thanks!

*** This bug has been marked as a duplicate of 397225 ***
Comment 7 Eugen Dedu 2009-05-22 16:42:32 UTC
Hi Alexander, and sorry not to check, I am short of time right now.  Please go ahead with the other patch.