Printing odd/even pages with multiple pages per sheet is broken
Categories
(Core :: Printing: Output, defect)
Tracking
()
People
(Reporter: groszdanielpub, Unassigned)
Details
Attachments
(3 files)
In the dialog to print a website or PDF, select an option to print multiple pages per sheet, and select Even or Odd pages.
Firefox filters the document down to odd/even pages, and then arranges them multiple pages per sheet.
Of course this defeats the purpose of the odd/even pages feature, which is to enable two-sided printing (on printers that don't natively support it) by printing the odd pages, turning the over stack of pages, and then printing the even pages.
The proper behavior, what most programs do, is to arrange it multiple pages per sheet, and then filter it down to odd/even pages (sheets). (At least logically, in terms of behavior; of course it may be possible to optimize it by skipping creating the sheets that won't be in the output.)
HTML pages and PDFs are both affected.
Printing to PDF and to a physical printer are both affected.
Firefox 158.0.1, Linux (openSUSE Tumbleweed 20261111), KDE Plasma 6.8.2, CUPS 2.4.20.
In the attached zip, numbers.html and numbers.pdf are input files you can test with. 4persheet.pdf and 4persheet_pdf.pdf are the respective outputs of printing them to PDF with 4 pages per sheet, and Odd pages only.
Comment 1•7 days ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Printing: Output' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•7 days ago
|
||
| frontend-triage | ||
PageRangeInput.updatePageRange in print.js builds the odd/even pageRanges by stepping source page numbers by 2 and ignores numPagesPerSheet. Layout then drops the unlisted pages before filling sheets (PrintedSheetFrame.cpp), so with N-up you get odd pages packed together, not odd sheets. The odd/even option was added in bug 35228 for manual duplex, and nothing there considered pages per sheet.
Fix: In print.js, make odd/even select every page of the odd (or even) sheets, where sheet s holds pages (s-1)N+1 to min(sN, total). Recompute in update(settings) when numPagesPerSheet changes, because the page-count handler returns early when the raw page count is unchanged. Disable "even" when total <= N, and extend browser_print_page_range.js with an N>1 case. The fix is in the dialog, which is Toolkit :: Printing, not layout.
Suggested severity: S3. Manual duplex with multiple pages per sheet gives unusable output, but it's a narrow combination, and printing N-up to PDF first and then printing that PDF's odd/even pages works around it.
If you'd like to provide feedback on this comment, please use the 👍 or 👎 reaction.
If you want to categorize your feedback you can add one of the following tags: ai-triage-{wrong-file, wrong-cause, hallucination, out-of-scope, not-a-bug, wrong-fix, shallow-fix, wrong-severity}.
Needinfo hackbot@mozilla.tld to have a patch generated for this bug, include any questions or directions as needed in your comment.
Comment 3•7 days ago
|
||
Yeah, seems like a reasonable use-case/ask.
Comment 4•7 days ago
|
||
Comment 5•7 days ago
•
|
||
(In reply to Dániel Grósz from comment #0)
The proper behavior, what most programs do, is to arrange it multiple pages per sheet, and then filter it down to odd/even pages (sheets). (At least logically, in terms of behavior; of course it may be possible to optimize it by skipping creating the sheets that won't be in the output.)
This seems reasonable to me as a use-case. But I'm curious, what other programs have you observed this behavior from? Was it just programs that use the GTK print dialog, or other programs as well?
I tested:
- Chrome: Matches Firefox (see screenshot)
- Safari (on macOS): N/A, doesn't offer even/odd page filtering
- LibreOffice: Matches Firefox
I did find that the GTK print dialog does match your expected behavior -- I printed a 16-page PDF in "papers" (gnome pdf viewer), with "Pages per side: 4" and "Only print: odd sheets". However it's a little bit different there, because the pages: ... selection and this "only print: [even|odd] sheets" are completely different settings there. You can express an arbitrary page selection, and then separately filter that by sheet index. If we wanted to match this behavior, we would probably want to split the UI in a similar way to avoid confusing the two.
Comment 6•7 days ago
•
|
||
So I think to hypothetically fix this, we would need to either:
(1) split out an additional "Sheets: [All|Even|Odd}" control in the print dialog (taking that out of the "Pages" dropdown), and then implement that even/odd filtering at a later stage than our page filtering.
...or:
(2) don't touch the UI, and just interpret a "pages: even|odd" as if it were actually talking about sheets, in the case where a user has requested multiple pages per sheet.
Option (1) is the most "correct" way to approach this from a doing-what-the-UI-says perspective (and it'd be most aligned with e.g. the prior art in the GTK print dialog), but it would add complexity to the Firefox print dialog, which we're reluctant to do from a UX perspective. (Users who just want to print a few pages would likely be confused about having two different ways to express that and might not know which they should use or why we're bothering asking twice.)
Option (2) is the most lightweight implementation-wise, but it would make the print dialog confusing in different ways, where you'd get very different output if you specify "Pages: 1,3,5,7,9,11,13,15" vs. "Pages: Odd" (in a multiple-pages-per-sheet scenario). The different-output would be expected for some users (e.g. the bug reporter), but it might also be surprising or at least feel like the labels are wrong/misleading, since intuitively "Pages: Odd" is saying the exact same thing as "Pages: [list of all the odd numbers]", so it's reasonable to expect it to produce the same output.
Also, just to set expectations -- given that neither Chrome nor Safari support this use-case (as far as I can tell at least), it might not be a priority for us to fix/deeply-investigate right away...
| Reporter | ||
Comment 7•6 days ago
|
||
(In reply to Daniel Holbert [:dholbert] from comment #5)
Created attachment 9686548 [details]
screenshot of Firefox (left) and Chrome (right) with odd-pages-only, 4-pages-per-sheet(In reply to Dániel Grósz from comment #0)
The proper behavior, what most programs do, is to arrange it multiple pages per sheet, and then filter it down to odd/even pages (sheets). (At least logically, in terms of behavior; of course it may be possible to optimize it by skipping creating the sheets that won't be in the output.)
This seems reasonable to me as a use-case. But I'm curious, what other programs have you observed this behavior from? Was it just programs that use the GTK print dialog, or other programs as well?
Hm, I take it back that most programs behave like that. I've never had this problem before, and I've printed several long documents (lecture notes etc.) recently 4-up with manual duplex, but I realize I usually first printed them to PDF 4-up, and then printed the odd/even pages of that.
It looks like KDE software don't allow using the n-up and even/odd features at the same time. Also, they delegate these features to CUPS, so they are unavailable with the default print-to-pdf feature. They can be used (and tested) with CUPS-PDF, which is presented to applications like a physical printer.
(In reply to Daniel Holbert [:dholbert] from comment #6)
So I think to hypothetically fix this, we would need to either:
(1) split out an additional "Sheets: [All|Even|Odd}" control in the print dialog (taking that out of the "Pages" dropdown), and then implement that even/odd filtering at a later stage than our page filtering....or:
(2) don't touch the UI, and just interpret a "pages: even|odd" as if it were actually talking about sheets, in the case where a user has requested multiple pages per sheet.
A middle ground is to provide only one control (interpreting it as talking about sheets), but moving it below the Pages per sheet setting.
Description
•