Search in sources :

Example 1 with Plugins

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");
    });
}
Also used : Engine(com.teamdev.jxbrowser.engine.Engine) Plugins(com.teamdev.jxbrowser.plugin.Plugins) Browser(com.teamdev.jxbrowser.browser.Browser)

Aggregations

Browser (com.teamdev.jxbrowser.browser.Browser)1 Engine (com.teamdev.jxbrowser.engine.Engine)1 Plugins (com.teamdev.jxbrowser.plugin.Plugins)1