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 set the initial view of a PDF in Java (Tutorial)

55 sec read

PDF with initial view using two page column and thumbnails

What is initial view?

A PDF document may have an initial view which determines how the document opens in PDF viewing software like Adobe Acrobat or JPedal Viewer.

The initial view can dictate which page the document should be opened on, the layout of the pages, and even which interactive panels should be open (e.g. the page thumbnails panel).

What is JPedal?

JPedal is our Java PDF library which we have been developing for over 20 years! It comes with a rich feature set and robust support for all kinds of PDF files.

How to set the initial view with JPedal?

First, you will need to download a JPedal jar and add it to your Java project. You can get a trial copy from our website.

Next, you need to create an instance of PdfManipulator, load the desired PDF, and use the set initial view command.

The example code below sets the initial view of a PDF to open on page 3, using a two page view mode, with the thumbnails panel open.

Download JPedal

You can get a JPedal trial jar to test setting the initial view of PDF files.

Resources

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.