use of com.teamdev.jxbrowser.plugin.Plugins in project JxBrowser-Examples by TeamDev-IP.
the class DisablePdfViewer method main.
public static void main(String[] args) {
Engine engine = Engine.newInstance(HARDWARE_ACCELERATED);
Plugins plugins = engine.plugins();
// #docfragment "disabling-pdf-viewer"
plugins.settings().disablePdfViewer();
// #enddocfragment "disabling-pdf-viewer"
Browser browser = engine.newBrowser();
invokeLater(() -> {
// Display a Swing frame with embedded BrowserView.
showGui(browser);
// Now, if you load a PDF document, it will not be displayed in the
// PDF Viewer and will be downloaded instead.
browser.navigation().loadUrl("http://www.orimi.com/pdf-test.pdf");
});
}