Hello,

I posted this on mozilla.dev.tech.xul and haven't had a response yet,
so I thought this group might be more appropriate.  Apologies to any
that are subscribed to both lists.

I'm trying to work out a couple final details, and I'm stuck on print
preview.  I can successfully do
var editor = document.getElementbyId('edit');
editor.contentWindow.print();

But what I'd like to do is bring up the default print-preview dialog.
I've been reading many posts on this subject, and the closest I've
come so far is this:
function print() {
        var editor = document.getElementById('edit');
        var req =
editor.contentWindow.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
        var wbprint =
req.getInterface(Components.interfaces.nsIWebBrowserPrint);
        var settings = PrintUtils.getPrintSettings();
        wbprint.printPreview(settings, req, null);

}

as found in this thread: 
http://groups.google.com/group/mozilla.dev.platform/msg/16451770b1bc8...
but with similar results; my preview window opens in the original
document, and with no controls.  I'm sure this is just a disconnect in
the use of XPCOM components, but if someone could straighten me out
I'd appreciate it!

John

* note that "editor" is an editable iframe

_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to