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 work, he’s a 1900‑rated chess player, guitarist, and French learner.

How to N-Up Pages in PDF Files in Java (Tutorial)

1 min read

n up pdf

If you have ever printed slides for a presentation and wanted to save paper when sharing handouts, you might have encountered N-up formatting. N-up is a common pre-print layout technique when working with PDF files and it means arranging multiple pages on a single sheet. For example, 2-up places two pages side by side, while 4-up puts four smaller pages on one sheet.

In the post, I will walk you through the N-up process using our PDF library JPedal.

Download JPedal

You will need to download the JPedal trial jar.

Add the jar to your project

For this example, I am going to use Maven. If you want to use another build system, check out the setup page on our support site.

Install the downloaded jar to your local Maven repository:

mvn install:install-file -Dfile= -DgroupId=com.idrsolutions -Dpackaging=jar -DartifactId=jpedal -Dversion=1.0

Add the following to your pom.xml file:

Add to your code

Create an instance of PDF Manipulator and call the N-up method. Applying a scaling factor of one half means the new sheet will be the same size as the original page, which is ideal for printing.

Learn more about the PDF Manipulator API.

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 work, he’s a 1900‑rated chess player, guitarist, and French learner.