|
|
Printing documents with WebRenderer is relatively
simple
IBrowserCanvas browser =
BrowserFactory.spawnMozilla(); browser.loadURL("http://developer.webrenderer.com");
browser.print(1);
Please
note
When printing documents
automatically using the print(2) function, it is important to wait for the
onDocumentComplete() event from within the Network Listener. This is to ensure
the document has loaded fully before printing.
See
"Events"
for capturing print status events
Close up
browser.print(int) takes int values for the type of
printing. If the "print" function is passed the int value "1", a Printer dialog
is shown, where the user can select printer specific features, and things such
as pages to print and printer to print
pages.
browser.print(2);
browser.print(2) prints silently to the
default printer. There are no noisy dialog boxes, the printer simply uses
underlying default printer settings.
browser.print(2,
"myprinter");
browser.print(2, "myprinter") prints silently to a
specified printer. The list of available printers can be obtained by the
following:
String[] availablePrinters =
browser.getPrinterNames();
A String array is returned with the available
printers names.
Other options that can be passed to the "print" function
include 1 = Do Default, 2 = Dont Prompt (silent), 3 = Show Help.
|