The Adobe Document Services PDF Tools API provides modern cloud-based capabilities for PDF manipulation. The API is accessible through SDKs which help you get up and running quickly. Once you’ve received your developer credential, download and set up one of the sample projects. After you’re familiar with the APIs, leverage the samples in your own server-side code.
Note
The SDK only supports server-based use cases where credentials are saved securely in a safe environment. SDK credentials should not be sent to untrusted environments or end user devices.
Developing with the PDF Tools SDK requires an Adobe-provided credential. To get one, click HERE, and complete the workflow. Be sure to copy and save the credential values to a secure location.
Validity term: The certificate associated with your credential is valid for one year. However, you can simply regenerate a new credential or apply a new certificate to the current credentials from the Document Cloud developer console.
Note
During the credential creation process you’ll be asked to whether you’d like a Personalized Code Sample Download. Choosing Personalized preconfigures the samples with your credential and removes a few steps from your development setup process.
Jump start your development by bookmarking or downloading the following key resources:
This document
Java library. The Maven project contains the .jar file.
Once you complete the Getting credentials workflow, a zip file automatically downloads that contains content whose structure varies based on whether you opted to download personalized code samples. The zip file structures are as follows:
Personalized Download: The samples download zip contains a private.key file and an adobe-dc-pdf-tools-sdk-java-samples with a preconfigured pdftools-api-credentials.json file.
Non Personalized Download: The samples download zip contains the private.key file and a pdftools-api-credentials.json file.
After downloading the zip, you can either run the samples in the zip directly, or you can replace the pdftools-api-credentials.json and private.key files in the sample code with those in the zip.
Example pdftools-api-credentials.json file
{
"client_credentials": {
"client_id": "<YOUR_CLIENT_ID>",
"client_secret": "<YOUR_CLIENT_SECRET>"
},
"service_account_credentials": {
"organization_id": "<YOUR_ORGANIZATION_ID>",
"account_id": "<YOUR_TECHNICAL_ACCOUNT_ID>",
"private_key_file": "<PRIVATE_KEY_FILE_PATH>"
}
}
Install Java 8 or above.
Run javac -version
to verify your install.
Verify the JDK bin folder is included in the PATH variable (method varies by OS).
Install Maven. You may use your preferred tool; for example:
Windows: Example: Chocolatey.
Macintosh: Example:
brew install maven
.
Note
Maven uses pom.xml to fetch pdftools-sdk from the public Maven repository when running the project. The .jar automatically downloads when you build the sample project. Alternatively, you can download the pdftools-sdk.jar file, and configure your own environment.
The quickest way to get up and running is to download the personalized code samples during the Getting Credentials workflow. These samples provide everything from ready-to-run sample code, an embedded credential json file, and pre-configured connections to dependencies.
Download the sample project.
Build the sample project with Maven: mvn clean install
.
Test the sample code on the command line.
Refer to this document for details about running samples as well as the API Reference for API details.
If you did not choose Personalized Code Sample Download during the credential setup process:
Download the sample project.
Find and replace pdftools-api-credentials.json with the one present in the downloaded zip file.
Find and replace private.key with the one present in the downloaded zip file.
Build the sample project with Maven: mvn clean install
.
Test the sample code on the command line.
Refer to this document for details about running samples as well as the API Reference for API details.
Tip
Command line execution is not mandatory. You can import the samples Maven project into your preferred IDE (e.g. IntelliJ/Eclipse) and run the samples from there.
For security reasons you may wish to confirm the installer’s authenticity. To do so,
After installing the package, navigate to the .jar.sha1
file.
Calculate the hash with any 3rd party utility.
Find and open PDF Tools sha1 file. Note: if you’re using Maven, look in the .m2 directory.
Verify the hash you generated matches the value in the .sha1 file.
9ee8e2eafae0450e9143d41c345ece3d879433b3
Refer to the API docs for error and exception details.
For logging, use the slf4j API with a log4js-slf4j binding.
Logging configurations are provided in src/main/resources/log4js.properties.
Specify alternate bindings, if required, in pom.xml.
log4js.properties file
name=PropertiesConfig appenders = console # A sample console appender configuration, Clients can change as per their logging implementation rootLogger.level = WARN rootLogger.appenderRefs = stdout rootLogger.appenderRef.stdout.ref = STDOUT appender.console.type = Console appender.console.name = STDOUT appender.console.layout.type = PatternLayout appender.console.layout.pattern = [%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n loggers = pdftoolssdk,validator,apache # Change the logging levels as per need. INFO is recommended for pdftools-sdk logger.pdftoolssdk.name = com.adobe.platform.operation logger.pdftoolssdk.level = INFO logger.pdftoolssdk.additivity = false logger.pdftoolssdk.appenderRef.console.ref = STDOUT logger.validator.name=org.hibernate logger.validator.level=WARN logger.apache.name=org.apache logger.apache.level=WARN
The sample files reference input and output files located in the sample project’s /resources/ directory. You can of course modify the files and paths or use your own files.
While the samples use Maven, you can use your own tools and process.
To build a custom project:
Access the .jar in the central Maven repository.
Use your preferred dependency management tool (Ivy, Gradle, Maven), to include the SDK .jar dependency.
Open the pdftools-api-credentials.json downloaded when you created your crediential.
Add the Authentication details as described above.
Jumpstart your development by bookmarking or downloading the following key resources:
This document
Input/output test files reside in the their respective sample directories
The samples project requires the following:
.NET Core: version 2.1 or above
A build Tool: Either Visual Studio or .NET Core CLI.
Once you complete the Getting credentials workflow, you will receive a zip file with content whose structure varies based on whether you opted to download personalized code samples. The zip file structures are as follows:
Personalized Download: The samples download zip contains a private.key file and an adobe-DC.PDFTools.SDK.NET.Samples directory. Each sample directory contains the sample code as well as a preconfigured pdftools-api-credentials.json file.
Non Personalized Download: The samples download zip contains the private.key file and unconfigured pdftools-api-credentials.json file.
After downloading the zip, you can either run the samples in the zip directly, or you can replace the pdftools-api-credentials.json and private.key files in the sample code with those in the zip.
Example pdftools-api-credentials.json file
{
"client_credentials": {
"client_id": "<YOUR_CLIENT_ID>",
"client_secret": "<YOUR_CLIENT_SECRET>"
},
"service_account_credentials": {
"organization_id": "<YOUR_ORGANIZATION_ID>",
"account_id": "<YOUR_TECHNICAL_ACCOUNT_ID>",
"private_key_file": "<PRIVATE_KEY_FILE_PATH>"
}
}
Running any sample or custom code requires the following:
Download and install the .NET SDK.
Note
The Nuget package automatically downloads when you build the sample project.
The quickest way to get up and running is to download the personalized code samples during the Getting Credentials workflow. These samples provide everything from ready-to-run sample code, an embedded credential json file, and pre-configured connections to dependencies.
Extract the downloaded samples .zip.
From the samples directory, build the sample project: dotnet build
.
Test the sample code on the command line.
Refer to this document for details about running samples as well as the API Reference for API details.
If you did not choose Personalized Code Sample Download during the credential setup process:
Clone or download the samples project.
Find and replace all occurrences of pdftools-api-credentials.json
and private.key
files with the ones present in your PDFToolsSDK-Credentials.zip file.
From the samples directory, build the sample project: dotnet build
.
Test the sample code on the command line.
Refer to this document for details about running samples as well as the API Reference for API details.
For security reasons you may wish to confirm the installer’s authenticity. To do so,
After installing the Nuget package, navigate to the .nuget directory.
Find and open the .sha512 file.
Verify the hash in the downloaded file matches the value published here.
P35RuDHk2as0F63BPqXF/Bhzq2H8U/r7aGqRprHrSR7fGGu/vnEO3SWC1/Quhd16/1s6/4TUda0WguWbs6gibA==
Refer to the API docs for error and exception details.
The .NET SDK uses LibLog as a bridge between different logging frameworks. Log4net is used as a logging provider in the sample projects and the logging configurations are provided in log4net.config. Add the configuration for your preferred provider and set up the necessary appender as required to enable logging.
log4net.config file
<log4net> <root> <level value="INFO" /> <appender-ref ref="console" /> </root> <appender name="console" type="log4net.Appender.ConsoleAppender"> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%date %level %logger - %message%newline" /> </layout> </appender> </log4net>
Refer to each sample directory for the requisite input/output files.
While building the sample project automatically downloads the Nuget package, you can do it manually if you wish to use your own tools and process.
Download the latest package.
Jumpstart your development by bookmarking or downloading the following key resources:
This document
Once you complete the Getting credentials workflow, you will receive a zip file with content whose structure varies based on whether you opted to download personalized code samples. The zip file structures are as follows:
Personalized Download: The samples download.zip contains a private.key file and an adobe-dc-pdf-tools-sdk-node-samples directory. Each sample directory contains the sample code as well as a preconfigured pdftools-api-credentials.json file.
Non Personalized Download: The samples download zip contains the private.key file and unconfigured pdftools-api-credentials.json file.
After downloading the zip, you can either run the samples in the zip directly, or you can replace the pdftools-api-credentials.json and private.key files in the sample code with those in the zip.
Example pdftools-api-credentials.json file
{
"client_credentials": {
"client_id": "<YOUR_CLIENT_ID>",
"client_secret": "<YOUR_CLIENT_SECRET>"
},
"service_account_credentials": {
"organization_id": "<YOUR_ORGANIZATION_ID>",
"account_id": "<YOUR_TECHNICAL_ACCOUNT_ID>",
"private_key_file": "<PRIVATE_KEY_FILE_PATH>"
}
}
Running any sample or custom code requires the following steps:
Install Node.js 10.13.0 or higher.
Note
The @adobe/documentservices-pdftools-node-sdk npm package automatically downloads when you build the sample project.
npm install --save @adobe/documentservices-pdftools-node-sdk
Extract the downloaded samples .zip.
From the samples root directory, run npm install
.
Test the sample code on the command line.
Refer to this document for details about running samples as well as the API Reference for API details.
If you did not choose Personalized Code Sample Download during the credential setup process:
Download the sample project.
Find and replace all occurrences of pdftools-api-credentials.json
and private.key
files with the ones present in your PDFToolsCredentials.zip file.
From the samples root directory, run npm install
.
Test the sample code on the command line.
Refer to this document for details about running samples as well as the API Reference for API details.
For security reasons you may wish to confirm the installer’s authenticity. To do so,
After installing the package, find and open package.json.
Find the “_integrity” key.
Verify the hash in the downloaded file matches the value published here.
sha512-euS1nyT7u5wyoLfc4GaCXw3bluazPLrF5MdrLo1NqdxJy6AEROT5A3+praF0ZfLMlV0jEoYpMRK9Jugy4emtvQ==
Refer to the API docs for error and exception details.
The SDK uses the log4js API for logging. During execution, the SDK searches for config/pdftools-sdk-log4js-config.json in the working directory and reads the logging properties from there. If you do not provide a configuration file, the default logging logs INFO to the console. Customize the logging settings as needed.
log4js.properties file
{ "appenders": { "consoleAppender": { "_comment": "A sample console appender configuration, Clients can change as per their logging implementation", "type": "console", "layout": { "type": "pattern", "pattern": "%d:[%p]: %m" } } }, "categories": { "default": { "appenders": [ "consoleAppender" ], "_comment": "Change the logging levels as per need. info is recommended for documentservices-pdftools-node-sdk", "level": "info" } } }
Refer to each sample project’s resource directory for the requisite input/output files.
While building the sample project automatically downloads the Node package, you can do it manually if you wish to use your own tools and process.
Go to https://www.npmjs.com/package/@adobe/documentservices-pdftools-node-sdk
Download the latest package.