Jacob Collins Jacob is the JPedal Product Lead and specialises in PDF creation and manipulation. He also develops Salesforce backend systems and contributes to marketing and support. Outside of work, he’s a 1900‑rated chess player, guitarist, and French learner.

How to remove blank pages from a PDF in Java (Tutorial)

39 sec read

(PDF logo)

The JPedal Java PDF library can remove blank pages from documents.

Rationale

But why might you want to do this? A common reason would be for saving paper when printing documents. Or perhaps you want to remove empty gaps from a presentation.

How to remove blank pages using Java

Since Java does not provide any native ways to interact with PDF files, you will need a PDF library. We have been developing JPedal for over 20 years and it contains a powerful PDF Manipulator.

Using the following code, we can scan the whole document and write out a version of it that does not contain any blank pages.

Download JPedal

You can download a JPedal trial jar to see you it works.

Resources

Learn more about manipulating PDF files in Java.

We can help you better understand the PDF format as developers who have been working with the format for more than 2 decades!



The JPedal PDF library allows you to solve these problems in Java


Jacob Collins Jacob is the JPedal Product Lead and specialises in PDF creation and manipulation. He also develops Salesforce backend systems and contributes to marketing and support. Outside of work, he’s a 1900‑rated chess player, guitarist, and French learner.