Skip to content
Guides

How to Use ComPDFKit PDF SDK for Java in Java Applications

This section will help you to quickly get started with ComPDFKit PDF SDK to make a Java application with step-by-step instructions.

Create a New Project

  1. Create a Java application using the IDE. Here we create a new Java project.

Add the Package of ComPDFKit PDF SDK for Java

  1. The first thing we need to do is to import ComPDFKit PDF SDK for Java. Copy "lib" to the project.

  1. Right click on the SDK and select Add as Library....

  2. Add the following code to Main.java:

    java
    static{
        try {
           NativeKMPDFKit.initialize("your license", "your deviceId", "", Constants.LIB_DIR_NAME);
        } catch (FileNotFoundException e) {
              throw new RuntimeException(e);
        }
    }
  3. Start the main method to print out the information of your computer's system version. If the information is printed successfully, you have integrated ComPDFKit PDF SDK for Java successfully!

Troubleshooting

  1. Problems

    If you meet some other problems when integrating our ComPDFKit PDF SDK for Java, feel free to contact ComPDFKit team.