I'm using XULRunner 1.8.1.3 on Linux via java SWT 3.3.

When I try printing with the print dialog (silent=false) I get an error:

"The page was replaced while you were trying to print.  Please try again.
An error ocurred while printing.  The function "print" returned an error
condition (0x80004004)"

When I try printing without the print dialog (silent=true) I get a different
error:

"There was a problem printing because the paper size you specified is not
supported by your printer.
An error ocurred while printing.  The function "print" returned an error
condition (0x80480014)"

Any help regarding either of these errors would be appreciated.

Here is the code:

nsIWebBrowser webBrowser = (nsIWebBrowser)_chordChartPane.getWebBrowser();
nsIDOMWindow window = webBrowser.getContentDOMWindow();
nsIInterfaceRequestor ir = (nsIInterfaceRequestor)
window.queryInterface(nsIInterfaceRequestor.NS_IINTERFACEREQUESTOR_IID);
nsIWebBrowserPrint print = (nsIWebBrowserPrint)ir.getInterface(
nsIWebBrowserPrint.NS_IWEBBROWSERPRINT_IID);

nsIPrintSettings settings=print.getGlobalPrintSettings();
settings.setPrintSilent(true); // display print dialog or not

print.print( settings, null );
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to