This page will describe how to build PDFBox. Most users should find the binary releases adequate, but
if you are contributing to PDFBox then you will need to know how to properly build the project.
You can obtain the latest source of PDFBox from SVN, see the
download page for information about
how to connect to SVN. The instructions below should also work for
a released/nightly distribution.
Starting with PDFBox 1.0.0, the default build system is based on Maven:
- Install Maven 2
- Run "mvn clean install" from the PDFBox root
The old Ant build is still available, and can be used especially for
building .NET binaries with IKVM:
Install ANT. PDFBox currently
uses 1.6.2 but other versions probably work as well.
Setup IKVM, if you want to build the .NET DLL version of PDFBox.
- IKVM binaries
In the build.properties, set the ikvm.dir property:
Run "ant" from the root PDFBox directory.
This will create the .zip package distribution. See the build file
for other ant targets.
If you want to run PDFBox from an IDE them you will need to add
the 'Resources' directory to the project classpath in your IDE.
Running/Debugging PDFBox in Eclipse
In order to run PDFBox from within Eclipse there are a couple things that need to be setup. Certain
pieces of functionality require access to the Resources folder. Here is an example of what you need
to do to run the ExtractText command line application.
- In Eclipse click on "run..." or "debug..."
- In the tree on the left select "Java Application" and click "New"
- Name it, select the correct project, and the main class
- Select the "Arguments" tab and enter the command line arguments to the app
- Select the "Classpath" tab, the pdfbox project and jars should already be added in the "User Entries"
- Select the "User Entries" item and click the "Advanced" button
- The "Add Folder" radio button should be selected, press ok
- Select the root of the pdfbox project, this will make the "Resources" folder available on the classpath.