Closed Bug 1752379 Opened 2 years ago Closed 2 years ago

Cannot print PDF without headers and footers

Categories

(Toolkit :: Printing, defect, P3)

Firefox 96
defect

Tracking

()

VERIFIED FIXED
102 Branch
Tracking Status
firefox102 --- verified
firefox103 --- verified

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.

Ref. https://support.mozilla.org/questions/1365930

Component: Untriaged → Print Preview
Product: Firefox → Core

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.

Component: Print Preview → Printing
Flags: needinfo?(mstriemer)
Product: Core → Toolkit

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

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(mstriemer)
Priority: -- → P3

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?

Flags: needinfo?(mstriemer)

We're getting more PDF printing problems on SUMO in Fx97+:

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.

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.

Flags: needinfo?(mstriemer)
Assignee: nobody → emilio
Status: NEW → ASSIGNED
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/899faef8632a
Don't hide margins / headers settings on PDF printing. r=mstriemer
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 102 Branch
Flags: qe-verify+

Verified as fixed on macOS 11.6, Windows 10 x64 and on Ubuntu 20.04 x64.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: