Resize a PDF Document using Java

Businesses don’t always fit into a standard design, so it makes sense to employ a file format that can be as dynamic as you are; PDFs are widely used and the perfect option for distributing documents to clients. Now let’s say you have a PDF of a brochure you want to make printable; to maximize its readability and usage, we have an API that can automatically and efficiently perform the operation for you.

To begin the process, install the Maven SDK by adding a reference to the repository in pom.xml:

<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>

Then, we will add a reference to the dependency:

<dependencies>
<dependency>
<groupId>com.github.Cloudmersive</groupId>
<artifactId>Cloudmersive.APIClient.Java</artifactId>
<version>v3.54</version>
</dependency>
</dependencies>

With the installation complete, we are now able to add the imports and call the EditPDFResize function:

// Import classes:
//import com.cloudmersive.client.invoker.ApiClient;
//import com.cloudmersive.client.invoker.ApiException;
//import com.cloudmersive.client.invoker.Configuration;
//import com.cloudmersive.client.invoker.auth.*;
//import com.cloudmersive.client.EditPdfApi;

Now your newly resized PDF document is ready to rock. In order to retrieve your personal API key, register for a free account on the Cloudmersive website to gain access to 800 API calls/month.

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.