Cannot print PDF without headers and footers
Categories
(Toolkit :: Printing, defect, P3)
Tracking
()
People
(Reporter: jscher2000, Assigned: emilio)
References
Details
Attachments
(3 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0
Steps to reproduce:
Open a PDF (example: https://www.copyright.gov/circs/circ61.pdf)
Call up print using either Ctrl+P or the print button on the viewer's toolbar
Actual results:
Headers and footers display in the preview. However, "More settings" does not have the controls displayed for web pages to turn off headers and footers. (<section id="more-settings-options">
is missing)
Expected results:
In my view, headers and footers should be omitted from PDF printouts by default, but giving the user control of headers/footers would be ideal.
Reporter | ||
Comment 1•2 years ago
|
||
Reporter | ||
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
Yeah, I've seen this, but this is a toolkit issue. It seems like we remove those settings here for PDF, but we don't ensure we use a consistent value. It seems the intention is that we always print without headers and footers, but right now we use the pref-saved value.
Comment 3•2 years ago
|
||
We indeed hide the margins and headers/footers, but the old value is being used.
It seems reasonable that we would disable headers/footers and reset the margins to default in this case.
Likely we want to do this in refreshSettings
[0] when the sourceIsPdf
[1] value is true (we'll likely want to move that to a property on PrintEventHandler
).
We'll want to make sure that we don't save these changes to prefs, and also don't allow changing them in the dialog.
[0] https://searchfox.org/mozilla-central/rev/90e5ec580b4334c54829d83d79222d0b3ca4c5df/toolkit/components/printing/content/print.js#456
[1] https://searchfox.org/mozilla-central/rev/90e5ec580b4334c54829d83d79222d0b3ca4c5df/toolkit/components/printing/content/print.js#189-190
Assignee | ||
Comment 4•2 years ago
|
||
Another, potentially-simpler option, specially since tweaking the margins of a PDF might be useful if printing to a separate paper size, might be to just un-hide the settings, wdyt?
Reporter | ||
Comment 5•2 years ago
|
||
We're getting more PDF printing problems on SUMO in Fx97+:
- Unwanted headers/footers: https://support.mozilla.org/questions/1368716
- Excess margins even with headers/footers suppressed: https://support.mozilla.org/questions/1368503
pdf.js has @page { margin: 0; }
but there must be some logic for overriding/disregarding it so that Firefox honors the user's margins. Perhaps there can be an exception for pdf.js?
That would facilitate print PDFs at "actual size" when the PDF paper size and selected paper size are the same, without downscaling. That is essential for printouts where exact measurements are important.
Comment 6•2 years ago
|
||
Yeah, I think we can unhide these settings. They might not do anything in the general case but would likely help avoid more issues here as well.
Assignee | ||
Comment 7•2 years ago
|
||
Updated•2 years ago
|
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/899faef8632a Don't hide margins / headers settings on PDF printing. r=mstriemer
Comment 9•2 years ago
|
||
bugherder |
Updated•2 years ago
|
Comment 10•2 years ago
|
||
Verified as fixed on macOS 11.6, Windows 10 x64 and on Ubuntu 20.04 x64.
Description
•