GNOME Bugzilla – Bug 460267
Printing two pages per sheet & only odd pages
Last modified: 2009-05-22 16:42:32 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:
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
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
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
Eugen, thanks for the patch. It just needs some time to jump into problem :)
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
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 ***
Hi Alexander, and sorry not to check, I am short of time right now. Please go ahead with the other patch.