-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lp -o page-set=even prints an extra blank page #541
Comments
Could you attach the PPD file of your print queue (from |
Sure, here it is This is another one using a virtual pdf printer (so I don't waste paper while doing tests) |
For the record, I face the exact same issue using only the regular GUI printing interface. I'm printing to a USB Canon MF4700 (auto-detected by CUPS), and if I select "pages: odd" and "output order: reverse" in the print menu for a 10-page document, I end up with 6 printed sheets, the first one being blank. I have no issue when I select "pages: even" so my workaround for now is to start printing the odd pages (reversed), remove the extra blank page, and then feed back the result to the printer for the even pages — but it's annoying and can waste a lot of paper if I forget doing it. I'd be happy to provide more information if you let me know what you need. It looks like at least one other person faced the issue here: https://access.redhat.com/solutions/76333 but I don't have subscription so cannot read the solution they ended up with. |
I can confirm this, and this is reproducible with cups-pdf. |
This one. cups-filters/filter/pdftopdf/pdftopdf_processor.cc Lines 412 to 414 in 6fd2bdf
|
Right now the logic is completely broken (duplex option is not set):
commands
If we invert the logic in However, this is also flawed. If I want just to print, say, the even pages of document in reverse, and not doing manual duplex, I will get first blank page in this scenario. @tillkamppeter, that was your change in 686a28d regarding Setting page-set=even and duplex=none results in filter failure.
What do you think? |
…nting#541) Since commit 686a28d pdftopdf started to insert extra blank page when printing even-paged documents in page-set=even mode. This was the attempt to fix two issues at once: * [Print 1-page documents in even mode][1] * Treat non-duplex even reverse printing as second step of manual duplex Unfortunately due to inverted logic this didn't fix any issues and introduced new one, outlined above. This code fixes printing 1-page documents in even mode, and prints exactly what the user requested in even mode for larger documents, without inserting extra blank pages. [1]: https://bugs.launchpad.net/ubuntu/+source/cups-filters/+bug/1340435
Since [commit 686a28d][2] pdftopdf started to insert extra blank page when printing even-paged documents in page-set=even mode. This was the attempt to fix two issues at once: * [Print 1-page documents in even mode][1] * Treat non-duplex even reverse printing as second step of manual duplex Unfortunately due to inverted logic this didn't fix any issues and introduced new one, outlined above. This code fixes printing 1-page documents in even mode, and prints exactly what the user requested in even mode for larger documents, without inserting extra blank pages. [cups-filters issue #541][3] [1]: https://bugs.launchpad.net/ubuntu/+source/cups-filters/+bug/1340435 [2]: OpenPrinting/cups-filters@686a28d [3]: OpenPrinting/cups-filters#541
Here's my attempt to fix this issue, and the issue with printing single page document in even mode. If anyone has ideas on how to distinguish between manual duplex vs just printing even pages in reverse, feel free to contribute. Maybe check whether the printer supports duplex, and assume that everything even-printed in reverse is manual duplex? |
I don't understand this sentence: I don't need to do anything for odd-paged documents (and neither for even-paged documents with my workaround mentioned in the original issue), I just have to wait for the odd pages to be printed then feed back the printed stack as is to print the even pages. |
If you would not remove the list with page 5, the page 4 would be printed on list 5, page 2 on list 3. You'll end with lists 1-nothing, 2-3, 4-5, and not 1-2, 3-4, 5-nothing. |
"Automated" manual printing, which the fix from 2014 tried to implement, is to insert extra first blank page when printing even pages in reverse. In this case you don't need to remove page 5 list, it would be just "skipped", as in printed in white. The printer would "remove" it for you. The drawback of such function is that if you're just want to print your 5-page document in even mode in reverse (not manual duplex, just regular print with such unusual settings), you'll have extra blank first page. |
you're right, I wonder why I never noticed that. |
Well, I'm confused: in my notes I have that lp does the right thing if the document has an odd number of pages (I guess because at the time it added the extra blank page) and I applied my workaround if the document has an even number of pages (since the extra blank page would mess up the result). Maybe something changed in the meantime? (though I don't see anything in the changelog.Debian of the cups-filters package - edit: pdftopdf is in the cups-filters-core-drivers but it has the same changelog). |
For cups-filters 2.x fixed in libcupsfilters commit OpenPrinting/libcupsfilters@0d98684e62 |
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. Backport of OpenPrinting/libcupsfilters@0d98684e62
For cups-filters 1.x fixed in cups-filters (1.x branch) commit 3534e01 |
Is it really? I just checked on Windows, it prints exactly what it say it does: only odd or only even pages, no extra blanks. With your fix, the option doesn't do what it say. I'm not saying it's not useful, it's just confusing. The options are not named "manual duplex step 1/2", and with this change is limited to The ticket title is |
@tillkamppeter, your fix breaks Previously 5-paged document with |
I'm using my forked manual_duplex_linux repository to print in manual duplex mode: it first print the odd pages then the even ones (in reverse order and rotated 180º to cater to the paper flow in my printer), so the option are
-o page-set=even -o collate=true -o outputorder=reverse -o orientation-requested=6
When the document has an odd number of pages, everything is fine, but if it has an even number of pages, an extra blank page is printed which messes up the order.
If I run the pdftopdf filter with those same parameters, no extra blank page is generated, so I don't know where that extra page comes from.
For the time being, I use pdftk to filter and rotate the even pages if the number of pages is even and lp just print them in reverse order.
This is on debian 12 with cups-filters 1.28-17-3, but I have the same problem on another computer still running ubuntu 18.
The text was updated successfully, but these errors were encountered: