Building PDFBox from source is only necessary if you’re wanting to contribute code to the PDFBox project. Most users should use the binary releases instead.
You can obtain the latest source of PDFBox from our SVN repo The current trunk is v3.0.0-SNAPSHOT. There is a seperate branch for the 1.8.x series. You can fetch the latest 2.0 trunk using Subversion:
svn checkout http://svn.apache.org/repos/asf/pdfbox/trunk/ cd trunk
Building PDFBox 2.0 requires a JDK with “unlimited strength” cryptography, which requires extra files to be installed. For JDK 7, see Java Cryptography Extension (JCE). If these files are not installed, building PDFBox will fail the following test:
TestPublicKeyEncryption.setUp:70 JCE unlimited strength jurisdiction policy files are not installed
In the root directory of PDFBox:
mvn clean install
The old Ant build is still available, and can be used especially for building .NET binaries with IKVM:
ant” from the root PDFBox directory. This will create the .zip package distribution. See the build file for other ant targets.
NOTE: 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.
The above instructions expect that you’re using Maven or another build tool like Ivy that supports Maven dependencies. If you instead use tools like Ant where you need to explicitly include all the required library jars in your application, you’ll need to do something different.
The easiest approach is to run
mvn dependency:copy-dependencies inside the pdfbox directory of the latest PDFBox source release. This will copy all the required and optional
libraries discussed above into the pdfbox/target/dependencies directory. You can then simply copy all the libraries you need from this directory to your application.