Closed Bug 1720178 Opened 4 years ago Closed 4 years ago

Printing from print button doesn't work.

Categories

(Toolkit :: Printing, defect, P1)

defect

Tracking

()

VERIFIED FIXED
92 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox90 --- unaffected
firefox91 blocking verified
firefox92 --- verified

People

(Reporter: calixte, Assigned: mstriemer)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

No problem when printing from ctrl+P and no problem with a pdf without XFA.

:Snuffleupagus, would you have any idea here ?

Blocks: pdf-xfa
Flags: needinfo?(jonas.jenwald)

(In reply to Calixte Denizet (:calixte) from comment #1)

:Snuffleupagus, would you have any idea here ?

I don't think that this is a PDF.js bug/regression, since then you'd expect that all ways of triggering printing would be equally broken and considering that the code-paths involved when clicking on the Print-button (in the PDF Viewer toolbar) hasn't changed recently.
Note that manually triggering window.print() in the console, which is what that Print-button indirectly does, is also broken.

Running mozregression points to https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=36a1cc27b2645047fd2511b15ecf28a2838e3769&tochange=532840a9ae885348268858505f77fbac21e50caf, which suggests that this regressed in bug 1666247.

Flags: needinfo?(jonas.jenwald)
Keywords: regression
Regressed by: 1666247
Has Regression Range: --- → yes
Flags: needinfo?(mstriemer)

A STR:

It works as expected with "normal" pdfs.

For information, we inject a html to print in the xfa case:
https://github.com/mozilla/pdf.js/blob/4d130d066c3fb0786780eba6d2c809bb4ebad28d/web/firefox_print_service.js#L136
and we've few specific css rules:
https://github.com/mozilla/pdf.js/blob/4d130d066c3fb0786780eba6d2c809bb4ebad28d/web/viewer.css#L1847-L1857

:mstriemer, could you help here ?
If something is wrong on pdf.js' side, please tell me and we'll fix.

Additionally, the browser console shows:

AbortError: Actor 'PrintingSelection' destroyed before query 'PrintingSelection:HasSelection' was resolved print.js:190
    init chrome://global/content/print.js:190
    AsyncFunctionThrow self-hosted:696

So I don't really know why the actor is being destroyed, but I don't think we can use print selection only with window.print() calls since the browser that we actually print is a preview browser clone of the webpage at the time of the window.print() call rather than the original web content.

It's likely worth figuring out why this error is occurring, but this patch should resolve the issue.

Set release status flags based on info from the regressing bug 1666247

Severity: -- → S1
Priority: -- → P1
Component: PDF Viewer → Printing
Product: Firefox → Toolkit

Printing https://bug1720411.bmoattachments.org/attachment.cgi?id=9231160 also doesn't work, so it looks like this isn't restricted to XFA forms.

No longer blocks: pdf-xfa, 1720159
Summary: XFA - Printing from print button doesn't work. → Printing from print button doesn't work.

(In reply to Mark Striemer [:mstriemer] from comment #6)

So I don't really know why the actor is being destroyed, but I don't think we can use print selection only with window.print() calls since the browser that we actually print is a preview browser clone of the webpage at the time of the window.print() call rather than the original web content.

It's likely worth figuring out why this error is occurring, but this patch should resolve the issue.

Mark, did you mean to ask for review for your patch?

Assignee: nobody → mstriemer
Status: NEW → ASSIGNED

I was not able to reproduce comment 8, but I can reproduce with comment 3.

[Tracking Requested - why for this release]: Printing regression on pdfs.

Attachment #9230863 - Attachment description: Bug 1720178 - Don't check for selection in window.print() calls → Bug 1720178 - Treat prints that error checking for selection as no selection r?sfoster
Pushed by mstriemer@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/92c30d71ff71 Treat prints that error checking for selection as no selection r=sfoster,emilio

Comment on attachment 9230863 [details]
Bug 1720178 - Treat prints that error checking for selection as no selection r?sfoster

Beta/Release Uplift Approval Request

  • User impact if declined: Pressing the Print icon in pdf.js results in a hung print dialog for some 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 3
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): This code was previously in a try/catch since it could fail, and that was erroneously changed. Patch returns the try/catch check
  • String changes made/needed: None
Flags: needinfo?(mstriemer)
Attachment #9230863 - Flags: approval-mozilla-beta?
Flags: qe-verify+

(In reply to Sam Foster [:sfoster] (he/him) from comment #10)

I was not able to reproduce comment 8, but I can reproduce with comment 3.

I can only reproduce comment 8 intermittently.

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 92 Branch

Comment on attachment 9230863 [details]
Bug 1720178 - Treat prints that error checking for selection as no selection r?sfoster

Approved for 91 beta 6, thanks.

Attachment #9230863 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [qa-triaged]

Reproduced the issue with Firefox 92.0a1 (20210712215604) on Windows 10x64 and STR from comment 3.
The issue is verified fixed with Firefox 92.0a1 and 91.0b6 on Windows 10x64, macOS 10.15 and Ubuntu 21.05. The print button is working as expected when using STR from comment 3.

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

Attachment

General

Created:
Updated:
Size: