Closed Bug 1659395 Opened 4 years ago Closed 4 years ago

Saving to PDF does not function correctly

Categories

(Toolkit :: Printing, defect, P1)

Firefox 81
Desktop
All
defect

Tracking

()

VERIFIED FIXED
81 Branch
Tracking Status
firefox81 --- verified

People

(Reporter: vlucaci, Assigned: mstriemer)

References

(Blocks 1 open bug)

Details

(Whiteboard: [print2020_v81] )

Attachments

(1 file)

Affected versions

  • 81.0a1(20200816214203)

Affected platforms

  • macOS 10.15.6
  • Ubuntu 18.04

Steps to reproduce

  1. Launch FF.
  2. Trigger the new modal UI.
  3. In the drop-down , select Print to PDF.
  4. Print.

Expected result

  • Page is successfully printed to PDF.

Actual result

  • A blank .txt file is generated and at the same time, an actual print is performed on the printer.

Suggested Severity

  • I would consider this issue an S1 seeing as how no PDF is generated and actual papers are being printed.

Regression range

  • Not a regression

Other notes

I'm not sure if we expected this to work, but when I tried it, it gave me the same results… 😂

Severity: -- → S1
Priority: -- → P1

You need to set:

settings.printToFile = true;
settings.outputFormat = nsIPrintSettings.kOutputFormatPDF;

around here:

https://searchfox.org/mozilla-central/rev/2f9eacd9d3d995c937b4251a5557d95d494c9be1/toolkit/components/printing/content/print.js#97

Flags: needinfo?(mstriemer)

outputFormat is set again in PrintingChild.jsm [1] since I didn't see a flag to save it to prefs. When the save to PDF printer is selected we set the outputFormat [2] on the settings object which gets passed through to the Printing:Child:Enter call [3].

If this is on macOS what I see there is that the print always goes to the default printer. If I select Save to PDF or a printer that isn't on my current network the print still goes to my printer I last printed to.

We aren't setting printToFile, I can add that but this currently works on Windows and there seems to be some other underlying issue on macOS.

[1] https://searchfox.org/mozilla-central/rev/2f9eacd9d3d995c937b4251a5557d95d494c9be1/toolkit/actors/PrintingChild.jsm#327-329
[2] https://searchfox.org/mozilla-central/rev/2f9eacd9d3d995c937b4251a5557d95d494c9be1/toolkit/components/printing/content/print.js#322
[3] https://searchfox.org/mozilla-central/rev/2f9eacd9d3d995c937b4251a5557d95d494c9be1/toolkit/components/printing/content/printUtils.js#229

Flags: needinfo?(mstriemer)
Assignee: nobody → mstriemer
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
Has STR: --- → yes

Verified fixed with the latest builds, Fx 82.0a1 (2020-08-25) and Fx 81.0b2 on macOS 10.15 and Ubuntu 20.04

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

Attachment

General

Created:
Updated:
Size: