How to setup in IntelliJ IDEA
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 IntelliJ IDEA.
This tutorial will show you how to set up a project and start using JPedal in IntelliJ IDEA 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 IntelliJ IDEA:
If you haven’t already, download the latest copy of IntelliJ IDEA.
Step 2 - Clone repository:
Once you have gone through the installation process, you will want to clone the sample repository.
Open up IntelliJ IDEA and click on menu option: VCS - > Get from Version Control
In the new popup window (shown below) set the following values.
- Version control: Git
- URL: https://github.com/idrsolutions/jpedal-code-example.git
Once done, your fields should look like this, then click the clone button.
Step 3 - Add the JPedal JAR:
In the project pane in the IDE bring up the context menu (right-click) for the project folder and select Open Module Settings.
In the settings window, go to the libraries tab and click the ‘+’ button and select Java.
In the file-finder that opens, select your JPedal jar and you are done.
Step 4 - Start coding:
Now you can go ahead and start editing the code and writing your own. The project contains a class called JPedalExamples which contains several methods you can start modifying and using.
IntelliJ by default will build the project when you want to run your code which can be done by setting up a configuration or you can right-click a class with a main method and select Run from the context menu.
Want to add more to your project?
Check out the following tutorials for more information to see what JPedal can do for you:
- Convert PDF to an Image
- View PDF in Java
- Print PDF from Java
- Search the Text in PDF
- Extract Text from PDF
- Extract Images from PDF
- Extract Metadata from PDF
- Edit PDF Form Annotations