Note: Advice in this article will only work for JxBrowser 6. See the corresponding article for JxBrowser 7 here.

JxBrowser allows displaying PDF document using Chromium PDF Viewer plugin. You can display PDF file available on a remote web server (using URL of the PDF file) or a PDF file located on your local file system.


import com.teamdev.jxbrowser.chromium.Browser;
import com.teamdev.jxbrowser.chromium.swing.BrowserView;

import javax.swing.*;
import java.awt.*;

 * The sample demonstrates capability of JxBrowser to display PDF documents using
 * built-in Chromium PDF Viewer.
public class PDFViewerSample {
    public static void main(String[] args) {
        Browser browser = new Browser();
        BrowserView view = new BrowserView(browser);

        JFrame frame = new JFrame();
        frame.add(view, BorderLayout.CENTER);
        frame.setSize(800, 600);