Support and resources
Samples and Documentation
Code Samples
The latest samples for PDF4Java are available on GitHub here:
https://github.com/pdf4dev-solutions/pdf4javaOnline Documentation
PDF4Java Class Reference:
https://pdf4dev.com/pdf4java/help/pdf4java/pdf4java.htmlPDF4Java.Render Class Reference:
https://pdf4dev.com/pdf4java/help/pdf4java.render/pdf4java.render.htmlHow to use the PDF4Java library from command line:
Replace x.y.z.w with your JAR version number in these commands.
-
1. Include the library JAR in the classpath when compiling:
javac -cp .;/path/to/PDF4Java-x.y.z.w.jar Application.java -
2. Specify the library paths when running the application:
java.exe -Djava.library.path=/path/to/library/ -classpath .;/path/to/library/PDF4Java-x.y.z.w.jar Application
How to use the PDF4Java library with Maven:
Use your JAR version in place of x.y.z.w. The install commands use Windows line continuation (^); on Linux, use \ instead.
-
1. Install each library into your local Maven repository:
mvn install:install-file ^ -Dfile=/path/to/library/PDF4Java-x.y.z.w.jar ^ -DgroupId=com.o2sol ^ -DartifactId=pdf4java ^ -Dversion=x.y.z.w ^ -Dpackaging=jar ^ -DgeneratePom=true mvn install:install-file ^ -Dfile=/path/to/library/PDF4Java.Cmaps-x.y.z.w.jar ^ -DgroupId=com.o2sol ^ -DartifactId=pdf4java.cmaps ^ -Dversion=x.y.z.w ^ -Dpackaging=jar ^ -DgeneratePom=true mvn install:install-file ^ -Dfile=/path/to/library/PDF4Java.Render-x.y.z.w.jar ^ -DgroupId=com.o2sol ^ -DartifactId=pdf4java.render ^ -Dversion=x.y.z.w ^ -Dpackaging=jar ^ -DgeneratePom=true -
2. Add the library dependencies to
pom.xml:<dependencies> <dependency> <groupId>com.o2sol</groupId> <artifactId>pdf4java</artifactId> <version>x.y.z.w</version> </dependency> <dependency> <groupId>com.o2sol</groupId> <artifactId>pdf4java.cmaps</artifactId> <version>x.y.z.w</version> </dependency> <dependency> <groupId>com.o2sol</groupId> <artifactId>pdf4java.render</artifactId> <version>x.y.z.w</version> </dependency> </dependencies>
NOTE:
The samples provided here and on GitHub are for educational purposes only, to help developers understand and use PDF4Java library more effectively. However, they are provided AS-IS with no support or warranties expressed or implied. If you discover a problem, send an email to techsupport@pdf4dev.com and we'll try to fix it.
FAQ
What platforms supports PDF4Java?
PDF4Java supports Java 8 and higher.
Can I convert PDF pages to images using PDF4Java?
PDF to image conversion is supported in PDF4Java.Render add-on package which is licensed separately from PDF4Java library.
Can I purchase only the PDF4Java.Render add-on library?
No, the PDF4Java.Render add-on library requires also a commercial license of PDF4Java library to be purchased.
How can I purchase the PDF4Java.Render add-on library?
The PDF4Java.Render add-on library can be purchased together with PDF4Java library or anytime later (see below).
I have an existing PDF4Java license, can I purchase the PDF4Java.Render add-on library?
Yes, if you have an active support subscription for the PDF4Java license. The support subscription for the PDF4Java.Render add-on library matches the support subscription of the PDF4Java library and does not extend it. If you do not have an active PDF4Java support subscription, you have to renew the PDF4Java support subscription (or upgrade your license if not eligible for standard renewal) and then you can purchase the PDF4Java.Render add-on.
Can PDF4Java rebuild all damaged PDF files?
At this moment the PDF4Java library can rebuild only PDF files with damaged xref sections. We plan to extend this feature to support other types of damaged PDF files.
Can I still use the library after my subscription expired?
Yes, you can. The subscription refers strictly to the period of time you get technical support and have free access to new releases of PDF4Java library. A 1 year subscription means free access for a year to new releases. The renewal of the subscription is not mandatory, after the subscription expired, you can continue to use the library in development and royalty free deploy/distribute your applications for unlimited time. You just do not have free access to new versions of the library that were released after your subscription expired.
Can PDF4Java be used as a printer driver?
PDF4Java library can not be used as a printer driver for creating pdf files from Windows applications. It is a Java library to create pdf files from code.
Can PDF4Java print existing pdf files to an installed printer?
PDF4Java library can not print existing pdf files to a printer, it can only create pdf files from code.