Java PDF Viewer for your Java Applications

Providing everything needed to embed customizable PDF Reader in a Java client API

Display PDF files in your Java Applications

JPedal is supplied as a jar or via Gradle or Maven.

Add these lines of code into your Java code:

Viewer viewer = new Viewer();
viewer.setupViewer();
viewer.executeCommand(ViewerCommands.OPENFILE, "pdfFile.pdf");
ConvertPagesToImages.writeAllPagesAsImagesToDir("inputFileOrDir", "outputDir", "bmp", 1.33f);
ExtractTextAsWordList.writeAllWordlistsToDir("inputFileOrDirectory", "outputDir", -1);
ArrayList<Float[]> resultsForPages = FindTextInRectangle.findTextOnAllPages("/path/to/file.pdf", "textToFind");
PrintPdfPages print = new PrintPdfPages("C:/pdfs/mypdf.pdf");

if (print.openPDFFile()) {
    print.printAllPages("Printer Name");
}
final PdfUtilities utilities = new PdfUtilities("path/to/exampleFile.pdf");

try {
    if (utilities.openPDFFile()) {
        // Returns a String containing all metadata fields for the document
        final String documentPropertiesAsXML = utilities.getDocumentPropertyFieldsInXML();

        // Returns the total page count as an int
        final int totalPageCount = utilities.getPageCount();

        for (int i = 1; i != totalPageCount; i++) {
            // Get the page dimensions for the specified page in the given units and type
            final float[] pageDimensions = utilities.getPageDimensions(i, PdfUtilities.PageUnits.Pixels, PdfUtilities.PageSizeType.CropBox);

            // Returns the image data as a String for the specified page
            final String xImageDataForPage = utilities.getXImageDataForPage(i);
        }
    }
}
catch (final PdfException e) {
    e.printStackTrace();
}
utilities.closePDFfile();
WritableAnnotation[] annotations = new WritableAnnotation[2];
annotations[0] = new SquareAnnotation(1, 10, 10, 100, 100);
annotations[1] = new CircleAnnotation(2, 10, 10, 100, 100);
AnnotationWriter.writeAnnotations(inputFile, outputFile, annotation);
ExtractClippedImages.writeAllClippedImagesToDir("inputFileOrDirectory", "outputDir", "outputImageFormat", new String[] {"imageHeightAsFloat", "subDirectoryForHeight"});

What do other developers think?

JPedal PDF Viewer Key Features

JPedal provides a complete Java PDF Viewer which is easy to integrate and customise into your Java applications as a Swing Component. Features include:

Complete PDF Viewer

Complete PDF Viewer

View pages in Multiple Modes

JPedal provides all the display modes present in Adobe Acrobat along with Page turning and its own unique Page Flow mode.

Viewing PDF file in Single Page Mode

Single Page Mode

Viewing PDF file in Continuous Mode

Continuous Mode

Viewing PDF file in Continuous Facing Mode

Continuous Facing Mode

Viewing PDF file in JPedal Facing Mode

Facing Mode

Viewing PDF file in Page Flow Mode

Page Flow Mode

Navigate PDF Documents

JPedal supports all PDF Document navigation features including Bookmarks and Layers.

Bookmarks shown if included

Bookmarks shows if included

Dynamic support for Layers

Dynamic support for Layers

Page Scrolling

Page Scrolling

ToolBar and keyboard shortcuts

ToolBar and keyboard shortcuts

Print PDF Files

JPedal can print PDF files directly from the PDF Viewer.

  • Select any available printer
  • Preview output in GUI window
  • Specify the scaling, page margins and resolution
  • Choose any page range including odd or even pages or any sequence.
  • Print in grayscale
  • Print in fast draft mode
  • Choose paper source by PDF page size

Display/Edit PDF Forms

JPedal includes full support for PDF forms.

  • Display original AcroForms
  • Support for pure/mixed/legacy XFA PDF forms
  • Convert Forms into editable Swing widgets
  • Resave Form data back to PDF file
  • AP streams used if available
  • Display of form signatures supported

Find / Search Text

JPedal can search for text directly from the PDF Viewer.

  • Search one page or the whole document
  • Use Regular Expressions
  • Restrict search results to whole words
  • Search with case sensitivity
  • Allow search results across multiple lines
  • Ignore space characters when searching

Add / Edit PDF Annotations

JPedal can only view but also edit and add annotations to PDF files.

  • Edit existing Annotations
  • Add new Annotations
  • Resave edited file
  • GUI Drag and Drop editor

Zoom, Scale, Rotate PDF Pages

JPedal can dynamically change the view with scaling and rotation options.

  • Clockwise and anti-clockwise rotation
  • Scale in or out by any percentage
  • Fit to Page, Width, Height
  • Pages are dynamically resampled to optimise image shown at given scaling.

Restrict user access to a PDF file

JPedal makes it very easy for Java Developers to remove any Viewer functionality, locking down access and preventing access to the PDF files.

  • Disable printing
  • Keep document in memory
  • Prevent text copying
  • Disable load and save
  • Add custom operations
  • Remove any menu option or button

Customise Viewer Appearance

JPedal makes it very easy for Java Developers to change the Look and Feel Used.

  • Change colours
  • Different fonts
  • Prevent/change pop-up messages
  • Unique icons
  • Internal Frame
  • Menu text

Get started with your free JPedal trial now