Support a 'pages per sheet' option in print preview
Categories
(Core :: Print Preview, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox83 | --- | fixed |
People
(Reporter: jwatt, Assigned: dholbert)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [print2020_v84])
Attachments
(8 files, 2 obsolete files)
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/plain
|
Details | |
(deleted),
application/pdf
|
Details | |
(deleted),
application/pdf
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details |
The new print preview design calls for allowing the user to select the number of pages they want per sheet and to be able to see the result of their selection in the preview. We will need to implement support for this at the platform level.
Reporter | ||
Comment 1•5 years ago
|
||
We should consider this together with the @page bug 851441 since that will involve reworking the same code ( https://searchfox.org/mozilla-central/source/layout/generic/nsPageSequenceFrame.cpp ).
Assignee | ||
Comment 2•4 years ago
|
||
I'll plan on taking this one.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 3•4 years ago
|
||
Assignee | ||
Comment 4•4 years ago
|
||
I'm not actually renaming these APIs yet, to avoid bitrotting folks & shaking
things up too much, but we should consider renaming them soon. This patch just
makes the subtlety and pages-vs-sheets distinction a bit clearer in the
documentation.
Depends on D86797
Assignee | ||
Comment 5•4 years ago
|
||
Depends on D86798
Assignee | ||
Comment 6•4 years ago
|
||
Depends on D86799
Assignee | ||
Comment 7•4 years ago
|
||
Here's the patch I'm using to test this feature locally -- (ab)using an about:config pref to set the default pages-per-sheet value (which then ends up being the pages-per-sheet value that we use).
To test, try applying the patch stack and this patch on top, and running:
./mach run --setpref "print.default_pps=9" https://www.mozilla.org/en-US/MPL/2.0/
Assignee | ||
Comment 8•4 years ago
|
||
These patches are mostly-complete. The attached patch stack adds a new attribute on nsIPrintSettings
called numPagesPerSheet
pref that will, for now, let you print with 1, 4, 9, or 16 pages per sheet. (support for 2 and 6 still coming)
Things that are currently missing:
- Support for 2 and 6 as options for pages-per-sheet, as noted above (these are the ones that will typically require rotating the paper's orientation, depending on paper size, so they're a bit more subtle).
- Working properly with page ranges (including/excluding pages)
- Carrying the value forward into the native dialog's settings (if the user picks some pages-per-sheet value in our new UI and then chooses "print using system dialog" and expects their choice to be carried forward into that dialog -- I'm pretty sure this doesn't work yet, at least).
Comment 9•4 years ago
|
||
Comment on attachment 9169552 [details]
Bug 1631452 part 0: Directly initialize nsSharedPageData member-var, and adjust its documentation. r?TYLin
Revision D86797 was moved to bug 1660294. Setting attachment 9169552 [details] to obsolete.
Comment 10•4 years ago
|
||
Comment on attachment 9169553 [details]
Bug 1631452 part 1: Tag the page-number-related attributes in nsIWebBrowserPrint as potentially needing a rename (since they're actually about sheet numbers). r?TYLin
Revision D86798 was moved to bug 1660294. Setting attachment 9169553 [details] to obsolete.
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 11•4 years ago
|
||
Here's an example of the output that this produces (in PDF form).
I generated this by applying this patch stack as well as the "dummy patch for testing", and then running
./mach run --setpref "print.default_pps=4" https://www.mozilla.org/en-US/MPL/2.0/
...and setting the following prefs all to 25:
print.printer_Mozilla_Save_to_PDF.print_unwriteable_margin_bottom
print.printer_Mozilla_Save_to_PDF.print_unwriteable_margin_left
print.printer_Mozilla_Save_to_PDF.print_unwriteable_margin_right
print.printer_Mozilla_Save_to_PDF.print_unwriteable_margin_top
...and then printing.
Without setting those prefs, we have the default behavior which has 0 unwriteable margins, which still produces fairly-reasonable output (see the attachment after this one), but the pages are smooshed directly against each other (which really means the footers/headers are smooshed together). I'll attach another PDF to demonstrate that problem next, and I'll spin off a separate bug for that (for which I think the only real solution is having some nonzero defaults for the unwriteable margins).
Assignee | ||
Comment 12•4 years ago
|
||
Assignee | ||
Comment 13•4 years ago
|
||
(I filed bug 1669910 on the fact that our zero-sized unwriteable margins produce kinda smooshed looking output [regardless of whether you're using pages-per-sheet, really].)
Assignee | ||
Comment 14•4 years ago
|
||
Updated•4 years ago
|
Assignee | ||
Comment 15•4 years ago
|
||
These tests are modified copies of the previous patch's subtest for a
4-pages-per-sheet scenario.
Depends on D93185
Updated•4 years ago
|
Assignee | ||
Comment 16•4 years ago
|
||
This patch is basically a workaround for this bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1671036
Depends on D93298
Comment 17•4 years ago
|
||
Comment 18•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a4cdd6ce7b4b
https://hg.mozilla.org/mozilla-central/rev/795a4e8543b3
https://hg.mozilla.org/mozilla-central/rev/951bffe50396
https://hg.mozilla.org/mozilla-central/rev/b46e187e3c2e
https://hg.mozilla.org/mozilla-central/rev/dbaa8eaf2753
Updated•4 years ago
|
Description
•