Skip to Content

How to setup up APDFL Java Interface with Maven

Estimated Reading Time: 4 Minutes

Installing and Configuring the Adobe PDF Library Maven Package

This guide explains how to configure your project's pom.xml file and manually install the Adobe PDF Library (APDFL) Maven package for use in Windows and Linux environments.

 

1. Project Configuration (pom.xml)

The standard Maven Central configuration may not include all components required for more complex implementations. Based on our sample applications, we recommend using the following dependency structure in your pom.xml.

For a stable production environment, use the latest APDFL package version available from Datalogics.

 

Recommended Dependencies

Replace APDFL_PACKAGE_VERSION_HERE with the version that matches the Maven package you downloaded.

<dependencies>

    <dependency>
        <groupId>com.datalogics.pdfl</groupId>
        <artifactId>pdfl</artifactId>
        <version>APDFL_PACKAGE_VERSION_HERE</version>
        <type>pom</type>
    </dependency>

    <dependency>
        <groupId>com.datalogics.pdfl</groupId>
        <artifactId>pdfl</artifactId>
        <version>APDFL_PACKAGE_VERSION_HERE</version>
    </dependency>

    <dependency>
        <groupId>com.datalogics.pdfl</groupId>
        <artifactId>pdfl</artifactId>
        <version>APDFL_PACKAGE_VERSION_HERE</version>
        <type>zip</type>
        <classifier>${jni.classifier}</classifier>
    </dependency>

    <dependency>
        <groupId>com.datalogics.pdfl</groupId>
        <artifactId>pdfl</artifactId>
        <version>APDFL_PACKAGE_VERSION_HERE</version>
        <type>zip</type>
        <classifier>resources</classifier>
    </dependency>

    <dependency>
        <groupId>com.datalogics.pdfl</groupId>
        <artifactId>pdfl</artifactId>
        <version>APDFL_PACKAGE_VERSION_HERE</version>
        <classifier>javadoc</classifier>
    </dependency>

</dependencies>

 

2. Supported Environments

Before proceeding, confirm that your system meets the following requirements.

Java

  • Java 8 or higher

Windows

  • x64

Linux

  • x64, x86, or ARM64
  • All Linux builds require glibc 2.28 or higher

3. Obtain the Maven Package

Download the APDFL Maven package from the Datalogics distribution provided with your license.

Example package name:

APDFL18.0.5PlusP1y_Win-x64-maven.zip

Extract the package to your local machine.

 

Important for Linux users

The Linux Maven package must be extracted on a Linux system. Extracting it on Windows and then copying the files to Linux will break the installation because Windows does not support Unix symbolic link files used in the package.

 

4. Access the Sample Applications

The APDFL Maven samples demonstrate how to build and run applications using the Maven artifacts you will install.

Clone the samples repository before continuing:

git clone https://github.com/datalogics/apdfl-java-maven-samples.git

This repository contains several example projects such as Annotations that will be used later to verify the installation.

 

5. Extract and Navigate to the Maven Package Directory

After extracting the Maven package, open your command line environment.

Navigate to the directory containing the artifact installation scripts.

Example:

cd APDFL18.0.5PlusP1y_Win-x64-maven/Maven/Java

 

6. Clean the Maven Cache (Optional)

If you previously installed APDFL artifacts, removing existing cached versions ensures a clean installation.

Windows

rmdir /s /q %USERPROFILE%\.m2\repository\com\datalogics\pdfl

Linux

rm -rf $HOME/.m2/repository/com/datalogics/pdfl

In some environments, particularly when running commands with elevated privileges, Maven artifacts may also appear in:

/root/.m2/repository/com/datalogics/pdfl

If necessary, remove this directory as well to avoid conflicts.

 

7. Install the Maven Artifacts

Run the following commands to install the APDFL artifacts into your local Maven repository.

Install the core library:

mvn -f create-artifacts.xml install

Install the forms extension:

mvn -f create-forms-ext-artifacts.xml install

 

8. Verify the Installation

Confirm that the artifacts were installed into your local Maven repository.

Windows

dir %USERPROFILE%\.m2\repository\com\datalogics\pdfl

Linux

ls $HOME/.m2/repository/com/datalogics/pdfl

You should see directories corresponding to the installed APDFL package version.

 

9. Build a Sample Application

Navigate to one of the sample projects you cloned earlier. For example:

cd apdfl-java-maven-samples/Annotations

Build the project:

mvn clean package dependency:copy-dependencies

This command compiles the sample and copies required dependencies into the target/dependency directory.

 

10. Run the Sample Application

After the build completes, run the sample application.

Windows

java -classpath "..\classes;..\dependency\*" com.datalogics.pdfl.samples.Annotations

Linux

java -Djava.library.path=target/lib -classpath "target/classes:target/dependency/*" com.datalogics.pdfl.samples.[SAMPLE_NAME]

Replace [SAMPLE_NAME] with the specific sample you want to run, for example Annotations.

 

Official Resources and Documentation

For additional information about configuration, supported environments, and version compatibility, see the following resources.

 

Main Configuration Guide
https://dev.datalogics.com/adobe-pdf-library/java/getting-started/

 

Release Notes and Version Correlation
https://dev.datalogics.com/adobe-pdf-library/documentation/release-notes/

 

Supported Environments
https://dev.datalogics.com/adobe-pdf-library/documentation/supported-environments/

 

Reference Maven Samples
https://github.com/datalogics/apdfl-java-maven-samples

How to setup up APDFL Java Interface with Maven
  • COMMENT