Closed Bug 1658029 Opened 4 years ago Closed 4 years ago

Add print-to-file implementation of the nsIPrinter interface.

Categories

(Core :: Printing: Setup, enhancement, P1)

Firefox 81
enhancement

Tracking

()

RESOLVED WONTFIX
Tracking Status
firefox81 --- affected

People

(Reporter: nordzilla, Assigned: nordzilla)

References

(Blocks 1 open bug)

Details

(Whiteboard: [print2020_v81] )

The print UI should have a printer listed as Print To File so that users can select this option when they want to print to PDF.

We can support this by creating an nsPrintToFile implementation and ensuring that it is present in all of the relevant printer lists.

I don't think it makes sense to have this.

The nsIPrinter objects are for getting information about a given printer, which allows the frontend to display a bunch of possible print settings, take user input to select some of those settings, then create an nsIPrintSettings object and pass it to the backend to create the print preview/do the print.

In the case of save-to-PDF it's really up to the frontend to choose what page sizes should be available to the user, what margins pages should have, etc. rather than have the backend make those sort of choices. The frontend should do something similar to the ExtensionAPI.tabs.saveAsPDF code. That is, after presenting some page options and getting the user's choices, it should open a dialog to get the path to save the PDF to, then create an nsIPrintSettings object and set the path and the other settings on that, and then also set:

printSettings.printSilent = true;
printSettings.outputFormat = Ci.nsIPrintSettings.kOutputFormatPDF;

and then instruct the backend to print.

Mark, please see the above.

Flags: needinfo?(mstriemer)

Ah, thanks! So it looks like bug 1653354 solved the Mac issues and we can proceed from the frontend.

I filed bug 1658043 to do this on the frontend side.

Flags: needinfo?(mstriemer)

Alright then, let's close this then :)

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.