Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct skipping even/odd pages for manual duplex
Fixes #541 The page-set option with choicers "even" and "odd" is designed for doing manual duplex, by printing the odd pages first, turning the printed pages over and put them back into the input tray and then print the even pages. If the total number of pages to be printed is odd, an empty page needs to be added to the end of the set of even pages to make the total number of pages even, to have a front and back for each sheet and so the correct pairs of pages are on each sheet and always all sheets are taken from the input tray to the output tray. This did not work correctly for 2 reasons: - The skipping of pages for the page-set and for the page-ranges options were done in the same step, the page ranges must be done first and from the resulting pages the even or odd pages need to get skipped. - To determine whether the total amount of pages to be printed is odd, only the actually printed pages, with the even or odd pages already skipped, ar counted, not the pages which would be printed if page-set is not used. This means especially that a 6-page document would have 3 even pages, so in the end 3 pages are counted and so an extra blank page is added (which is wrong as the document has 6 pages which is even). A 5-page document has 2 even pages, so an even number of pages gets counted and so no blank page gets added. Now we apply page-ranges and each page which gets printed according to that we count with the outputno variable. Then we skip the pages with even or odd outputno depending of the page-set option. In the end, output no is the number of all pages to be printed and so we know that if it is odd and we print the even pages, we need to add a blank page.
- Loading branch information