Java PDF library integration

Welcome to Apryse. Java for the Apryse SDK is cross-platform and supported on Windows, macOS and Linux. To get started, choose your preferred platform from the tabs below.

Windows Java PDF library integration

This guide will help you run Apryse samples and integrate a free trial of the Apryse SDK into Java applications on Windows. Your free trial includes unlimited trial usage and support from solution engineers.

Prerequisites

  • JDK >= 5.Make sure that the JDK has been added to your path environment variable.Please visit the Java FAQ section for more information about some of the common Java installation issues.
  • Apryse's Java PDF library for Windows:

Download the SDK

Run Apryse SDK in production

A commercial license key is required for use in a production environment. Please contact sales to purchase a commercial key or if you need any other license key assistance.

Keep your commercial license key confidential.

License keys are uniquely generated. Please make sure that it is not publicly available (e.g. in your public GitHub).

Initial setup

  1. Extract the folder from the .zip file.
  2. Get your Apryse trial key.

License Key

Apryse collects some data regarding your usage of the SDK for product improvement.

If you wish to continue without data collection, contact us and we will email you a no-tracking trial key for you to get started.

Run the samples

Navigate to the location of extracted contents. Find and enter the Samples folder. Here you can find sample code for a large number of features supported by the Apryse SDK.

Run a specific sample

  1. Find the sample you want to run and navigate into the JAVA folder inside.
  2. Find RunTest.bat and run it. This can be done using either CLI or with a double-click. The results should appear on a cmd window.

Run all samples

  1. Find runall_java.bat in the samples folder and double click it to run it. The results should appear on a cmd window.

Integrate into your application

  1. Add the PDFNet Maven repository in your top-level pom.xml.

XML

1<repositories>
2 <repository>
3 <id>pdftron</id>
4 <name>PDFNet Maven</name>
5 <url>https://pdftron.com/maven/release</url>
6 </repository>
7</repositories>

2. Add the PDFNet Maven dependency in your pom.xml.

XML

1<dependencies>
2 <dependency>
3 <groupId>com.pdftron</groupId>
4 <artifactId>PDFNet</artifactId>
5 <version>10.10.0</version>
6 </dependency>
7</dependencies>

Integrate into your application

  1. Add PDFNet Maven repository and dependency in your pom.xml.
  2. In your src\main\java\your\java\folder\, add the following code to your java files. We use src\main\java\com\mycompany\app\App.java as an example:

Java

1package com.mycompany.app;
2import com.pdftron.pdf.*;
3public class App
4{
5 public static void main(String[] args)
6 {
7 PDFNet.initialize("YOUR_APRYSE_LICENSE_KEY");
8 try {
9 // YOUR CODE GOES HERE
10 } catch (Exception e) {
11 }
12 PDFNet.terminate();
13 }
14}

To test your code, you can navigate to the root of your project and run the following commands:

Java

1mvn compile
2mvn exec:java -Dexec.mainClass=com.mycompany.app.App

If the program runs successfully, you should see no error in the terminal.

We have demonstrated how to integrate Apryse's Java SDK into your Maven project. If your have any questions, please don't hesitate to contact us!

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales