Link
Skip to main content

How to setup in Eclipse

JPedal is a Java PDF library that provides functionality to view, print, rasterize and extract content from PDF files in their own Java Applications. Whilst the library has a multitude of classes to access these features, you will likely want to add the functionality to your own system or maybe expand on what is provided. This can be done with an IDE such as Eclipse.

This tutorial will show you how to set up a project and start using JPedal in Eclipse using a sample JPedal project.

Please note: A trial or full copy of the JPedal jar is needed. You can download the trial jar from here.

Step 1 - Download and install Eclipse:

If you haven’t already, download the latest copy of Eclipse. download Eclipse

Step 2 - Clone the repository:

Go to the GitHub repository of our example and click on ‘Code’. clone repository

Either:

Or

  • Click ‘Download ZIP’ and extract zip to a path of your choice.

In the new project location, create a ‘lib’ directory, which will be used to store dependencies.

Step 3 - Create a project:

Open up Eclipse, click ‘File’ -> ‘New’ -> ‘Java Project’. Add a project name. Untick ‘Use default location’ and use ‘Browse’ to find the location of the cloned repository. Click ‘Finish’. Eclipse setup

Step 4 - Add JPedal dependency (trial or full version):

Now you have a project, find your copy of the JPedal jar file, add it to the ‘lib’ directory.

Right-click on your project and go to ‘Properties’. Then go to ‘Java Build Path’ -> ‘Libraries’. panel from right click

Click on ‘Add JARs…’, go to the lib folder, select the JPedal jar, click ‘Ok’, then ‘Apply and Close’.

properties window

Step 5 - Start coding:

public static void main(String[] args) {
    try {
        pdfToImage();
//        pdfViewer();
//        extractWords();
//        extractImages();
    } catch (final Exception e) {
        e.printStackTrace();
    }
}

Change the parameters of the action to point to the correct input/output

public static void pdfToImage() throws PdfException {
    ConvertPagesToImages.writeAllPagesAsImagesToDir("inputFile.pdf",
            "outputFolder", "png", 1.33f);
}

Click the run button.

Want to add more to your project?

Check out the following tutorials for more information to see what JPedal can do for you:


Why JPedal?

  • Actively developed commercial library with full support and no third party dependencies.
  • Process PDF files up to 3x faster than alternative Java PDF libraries.
  • Simple licensing options and source code access for OEM users.

Learn more about JPedal

Start Your Free Trial


Customer Downloads

Select Download