When printing a PDF using "save-to-PDF", we should default to the PDF's own page size
Categories
(Core :: Printing: Output, defect)
Tracking
()
People
(Reporter: dholbert, Assigned: fchasen)
References
(Blocks 1 open bug)
Details
Attachments
(4 files)
STR:
- Make sure you have
about:config
prefprint.save_as_pdf.use_page_rule_size_as_paper_size.enabled
set totrue
. - Load attached PDF. [1]
- Ctrl+P to open the print dialog, and be sure you've got "Save to PDF" chosen as your print target.
EXPECTED RESULTS:
We should show a preview with the virtual PDF "paper" sized to the PDF content that we're printing.
ACTUAL RESULTS:
Print preview shows the PDF "paper" placed onto a portrait-oriented sheet of US Letter paper (or probably whatever your default was).
There's no way to get EXPECTED RESULTS for this testcase, since the PDF isn't a standard size that we have available in our paper-size dropdown.
For comparison:
- Chrome gives EXPECTED RESULTS from these STR.
- Firefox gives EXPECTED RESULTS if I use modified STR, just using the HTML testcase from bug 1814236 instead of the attached PDF.
[1] Note: I generated the attached testcase by simply printing bug 1814236 to PDF.
Reporter | ||
Comment 1•2 years ago
|
||
Reporter | ||
Updated•2 years ago
|
Reporter | ||
Comment 2•2 years ago
|
||
Assignee | ||
Comment 3•2 years ago
|
||
The functionality for this is already in PDF.js and the demo of the viewer adds the page size style and will print correctly: https://mozilla.github.io/pdf.js/web/viewer.html
I think we just need to move over that code from the generic print service at https://github.com/mozilla/pdf.js/blob/master/web/pdf_print_service.js#L108-L121 to the Firefox print service at https://github.com/mozilla/pdf.js/blob/master/web/firefox_print_service.js#LL136C3-L136C9
I'll can submit a PR for that over on Github.
Assignee | ||
Updated•2 years ago
|
Reporter | ||
Comment 4•2 years ago
|
||
Thanks!
Comment 5•2 years ago
|
||
Assignee | ||
Comment 6•2 years ago
|
||
Fix for this was merged into PDF.js repo. will be included the next time the Firefox version of PDF.js is updated.
Updated•2 years ago
|
Assignee | ||
Comment 8•2 years ago
|
||
:marco, yep I'll add a test that checks the print-preview size is correct.
Per the linked rotation bugs, this change makes the first page the default orientation so as you noted some of those examples will work correctly now.
But anything with mixed orientation will still rotate any page that isn't the default orientation. Unfortunately while we have good at-page support for mixed sizes / orientation, we are far from being able print mixed paper sizes so they are still scaled to the size of the first page.
Reporter | ||
Comment 9•2 years ago
|
||
Note: I suspect bug 1838989 may be a regression from this bug. (That's a bug related to printing PDFs to a label printer, where the orientation became wrong starting in Firefox 114.)
Description
•