- Spell Checker
This guide shows how to work with the Printing API.
The web page can be printed using one of the following ways:
- Using the
Frame.print()method of the JxBrowser API. The method requests printing of the frame. If you need to print the whole page, you should call the
print()method in the main frame. For example:
The web page is not printed immediately. The
PrintCallback will be invoked to tell the engine how to handle the print request. By default all print requests are canceled.
To allow the print request and display the Print Preview dialog use the following code:
browser.set(PrintCallback.class, (params, callback) -> callback.showPrintPreview());
In the Print Preview dialog you can select the preferred printing options:
If you need to cancel or disable printing at all use the following approach:
browser.set(PrintCallback.class, (params, callback) -> callback.cancel());