When printing, PDFs are misaligned and clipped in v82 due to extra margins
Categories
(Core :: Printing: Setup, defect, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr78 | --- | unaffected |
firefox81 | --- | unaffected |
firefox82 | + | verified |
firefox83 | + | verified |
firefox84 | + | verified |
People
(Reporter: flaviobombonatti, Assigned: jfkthame)
References
(Regression)
Details
(Keywords: regression, Whiteboard: [print2020_v82][old-ui+])
Attachments
(3 files)
922.40 KB,
image/png
|
Details | |
47 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-beta+
jcristau
:
approval-mozilla-release+
|
Details | Review |
2.04 KB,
patch
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:82.0) Gecko/20100101 Firefox/82.0
Steps to reproduce:
*My FF version is not using the Chromium print prompt.
*macOS Catalina (10.15.7)
- Open example PDF: https://food-guide.canada.ca/static/assets/pdf/HEPs-Guide-nw-en.pdf
- Click printer icon.
- Set Paper size to "Letter". Set scale to 100%.
- Print OR Open with Preview.
Actual results:
There appear to be extra margins at the top and left sides, pushing some content off the printed document. Please see screenshot attached.
Expected results:
The printed document should match the onscreen PDF, since paper size is the same and scale is 100%.
Comment 1•4 years ago
|
||
Firefox 82+ is printing the PDF inside the margins used for web pages, and also printing headers and footers, which is a new (and undesired) behavior.
I tried a mozregression (with print.tab_modal.enabled
=> false) using the Windows GUI, but twice it halted here:
INFO : Narrowed nightly regression window from [2020-09-14, 2020-09-16] (2 days) to [2020-09-15, 2020-09-16] (1 days) (~0 steps left)
Bisecting on mozilla-central [24b91757 - d281ed99]
pushlog_url: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=24b917577203190f0e1c0b21f6ffaf4d07f1e8f6&tochange=d281ed9906a8f0e143239e31a1afad48f6c96617
repo_name: mozilla-central
Found mozilla-central build: a451ebba
app_name: firefox
build_date: 2020-09-16 12:02:43.950000
build_file: C:\Users\redacted.mozilla\mozregression\persist\a451ebba378e-shippable--mozilla-central--target.zip
build_type: integration
build_url: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/c48KKwxLTpCkgCRsZH2H3A/runs/0/artifacts/public%2Fbuild%2Ftarget.zip
changeset: a451ebba378efcce0967e508a8107ab14dd5edcb
repo_name: mozilla-central
repo_url: https://hg.mozilla.org/mozilla-central
task_id: c48KKwxLTpCkgCRsZH2H3A
mozregression doesn't launch that build (for unknown reasons). Perhaps our security software is gumming up the works.
![]() |
||
Comment 2•4 years ago
|
||
Thanks for the bug report flaviobombonatti, and for the bisection jscher2000!
It looks like this was probably caused by bug 1665001.
Updated•4 years ago
|
![]() |
||
Updated•4 years ago
|
Comment 3•4 years ago
|
||
Set release status flags based on info from the regressing bug 1665001
Updated•4 years ago
|
Assignee | ||
Comment 4•4 years ago
|
||
Yeah, this is a regression from bug 1665001.
If there's an @page
rule that calls for zero margins, we should absolutely respect that; it means the document has been designed to go fully to the edge of the paper, and likely is intended to fit exactly to the sheet. At that point, it's up to the document author/designer to consider whether some portion at the edges will in fact be unprintable and may get clipped, but we should not subvert their intention by scaling or shifting the output from where they've specified it should go.
I'm actually quite doubtful whether the clamping introduced in bug 1665001 (and in bug 1664227 for margins specified via the UI) is a good idea in general, but that's a broader discussion we may still need to have. But to address this specific case, I think we should at least ensure that margin: 0
in an @page
rule will be honored.
Assignee | ||
Comment 5•4 years ago
|
||
Updated•4 years ago
|
Assignee | ||
Comment 6•4 years ago
|
||
Comment on attachment 9183173 [details]
Bug 1672529 - Honor page margins of zero when requested by an @page rule. r=jwatt
Beta/Release Uplift Approval Request
- User impact if declined: PDF documents are misplaced on the paper (and likely clipped) when printing.
- Is this code covered by automated tests?: No
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: See comment 0.
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Targeted fix that only affects behavior when @page { margin: 0 } is present.
- String changes made/needed:
Assignee | ||
Updated•4 years ago
|
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/39fb16bafcdf Honor page margins of zero when requested by an @page rule. r=jwatt
Comment 8•4 years ago
|
||
Comment on attachment 9183173 [details]
Bug 1672529 - Honor page margins of zero when requested by an @page rule. r=jwatt
Taking in 83 beta 3, thanks.
Comment 9•4 years ago
|
||
bugherder uplift |
Comment 10•4 years ago
|
||
bugherder |
Comment 11•4 years ago
|
||
Thank you all for the rapid response.
For Firefox 82, if there is an 82.0.1, perhaps this patch could be taken for that.
Meanwhile, the simplest workaround would be to launch the PDF in the system viewer for printing. (Configuring the printer driver to report zero unwriteable area to applications probably would create problems for all documents other than PDFs.)
![]() |
||
Comment 12•4 years ago
|
||
Indeed. jfkthame, can you request approval for Release uplift?
![]() |
||
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 13•4 years ago
|
||
Comment on attachment 9183173 [details]
Bug 1672529 - Honor page margins of zero when requested by an @page rule. r=jwatt
Beta/Release Uplift Approval Request
- User impact if declined: PDF documents are misplaced on the paper and clipped when printing: regression that badly impacts users trying to print PDFs.
- Is this code covered by automated tests?: No
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: See comment 0
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Targeted fix that only affects behavior when @page { margin: 0 } is present.
- String changes made/needed: none
Comment 14•4 years ago
|
||
Confirming this issue as verified fixed on 84.0a1 (20201022215159) and 83.0b3(20201022171613). Verified using macOS 10.15.7 but also on Windows 10x64 and Ubuntu 20 just for safe measure.
Comment 15•4 years ago
|
||
Comment on attachment 9183173 [details]
Bug 1672529 - Honor page margins of zero when requested by an @page rule. r=jwatt
approved for 82.0.1
Comment 16•4 years ago
|
||
I'm hitting conflicts when grafting to m-r, can you provide a rebased patch?
Assignee | ||
Comment 17•4 years ago
|
||
Rebased to mozilla-release (needed because bug 1668406 is not present there).
Comment 18•4 years ago
|
||
bugherder uplift |
Comment 19•4 years ago
|
||
Confirming this issue as verified fixed in 82.0.1(20201026153733). Verified using macOS 10.15.7 and opened in preview as well as performed an actual print, both having the desired behavior.
Description
•