Essentially I'd like to do what the PrintPDF AddOn for Firefox does
(call the gecko engine to save the current web page as PDF). But I'd
like to do it programmatically from my Win32 app.

The code below is javascript from the PrintPDF AddOn. How to do this
with the ActiveX?

TIA,

Markus


    var webBrowserPrint =
window.content.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
    .getInterface(Components.interfaces.nsIWebBrowserPrint);

    var PSSVC = Components.classes["@mozilla.org/gfx/printsettings-
service;1"]
    .getService(Components.interfaces.nsIPrintSettingsService);

    var printSettings = PSSVC.newPrintSettings;

    printSettings.printToFile = true;
    printSettings.toFileName  = picker.file.path;
    printSettings.printSilent = true;
    printSettings.outputFormat =
Components.interfaces.nsIPrintSettings.kOutputFormatPDF;

    webBrowserPrint.print(printSettings, null);
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to