Some test text!

Hamburger Icon

Java / Guides

Get started with Java

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

Linux 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 Linux. Your free trial includes unlimited trial usage and support from solution engineers.


  • JDK version ≥ 5
  • Apryse SDK for Linux:

Download the SDK

Download the SDK

Run Apryse SDK in production
A commercial license key is required for use in a production environment. Please fill out our licensing form if you do not have a valid license key.
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.

Login / Sign Up to get a trial key

Run the samples

Run a specific sample

  1. Navigate to the JAVA folder in a sample project, for example /Samples/AddImageTest/JAVA and run the sample with

Run all samples

  1. Navigate to /Samples and run

The tests will run one by one.

Output files will be in /Samples/TestFiles/Output

Integrate into your application

Manual Integration

Maven Integration

Gradle Integration

This section will show you how to use our SDK to create a simple Apryse "Hello World!" application. It will create a document with one blank page and save it as a linearized PDF in its running directory.

  1. Navigate to the /Samples directory of the Apryse SDK and create a directory called myApp if it does not exist already. This guide will assume your project is named myApp.

  2. Enter your myApp directory and create a JAVA directory for organization. Then create a file. Open this file in your favorite text editor and paste:

    import com.pdftron.common.PDFNetException;
    import com.pdftron.pdf.*;
    import com.pdftron.sdf.SDFDoc;
    import com.pdftron.sdf.ObjSet;
    import com.pdftron.sdf.Obj;
    public class myApp
        public static void main(String[] args)
            PDFNet.initialize();  // PDFNet must be initialized before accessing any Apryse API
                PDFDoc doc = new PDFDoc();
                Page page = doc.pageCreate();  // Start a new page
                doc.pagePushBack(page);  // Add the page to the document
      "output.pdf", SDFDoc.SaveMode.LINEARIZED, null);  // Save the document as a linearized PDF
            catch(PDFNetException e)
            System.out.println("Hello World!");
  3. Navigate back to your myApp project folder and compile your application using our PDFNet library:

    javac -cp .:../../../Lib/PDFNet.jar
  4. Run the project by executing:

    java -Djava.library.path=../../../Lib -classpath .:../../../Lib/PDFNet.jar myApp

    If all goes well, your terminal should output:

    PDFNet is running in demo mode.
    Permission: write
    Hello World!

Check the output.pdf that the program output in the same directory. It should be a PDF with one blank page.

Next step

Guides API docsSamples


Check the troubleshooting page if you run into any issues going through this document.

Get the answers you need: Chat with us