Set up the Nutrient Java PDF SDK with Maven and Gradle
This guide helps you integrate Nutrient Java SDK for advanced document capabilities (PDF, Word, Excel, and more). It also shows how to build tools that automatically handle its download and updates. By the end, you’ll be able to load a PDF document into your application using the Nutrient Java SDK API.
Nutrient Java SDK is distributed through the public Maven Central(opens in a new tab) repository. There you can find snippets for most popular build systems, along with the Gradle and Maven examples in this guide.
In the dependent module’s
build.gradlefile, add the Nutrient dependency:dependencies {implementation group: 'io.nutrient', name: 'nutrient-java-sdk', version: '2.1.4'}
In the dependent module’s
pom.xmlfile, add the Nutrient dependency:<dependency><groupId>io.nutrient</groupId><artifactId>nutrient-java-sdk</artifactId><version>2.1.4</version></dependency>
Using Nutrient Java SDK
After you add the Nutrient library, you can use the SDK in your application.
import io.nutrient.sdk.Document;import io.nutrient.sdk.DocumentNext, load a document:
try(Document document = Document.open("path/to/document.pdf")){ // actions on this document}Document.open("path/to/document.pdf").use { document -> // actions on this document}Once you have a document loaded, you can start using the rest of the library. Refer to the API documentation and guides for more information. Each guide includes a ready-made sample project you can download at the bottom to bootstrap your own projects.
Good starting points for exploring the SDK’s capabilities: