Please choose a menu option
Visit the IDRsolutions WebSite

Linearized PDF files

Introduction

Linearized PDF files are specially organized PDF files designed to display before the PDF file has finished loading. Ordinary PDF files cannot be displayed until the whole file is available which can cause issues if the file is being accessed from the Internet. Commercial versions of JPedal from 4.10 onwards support this feature.

 

How to tell if a PDF is linearized

If a file is linearized, the word (linearized) will appear in the title bar of the JPedal viewer. If you open the PDF in Adobe Acrobat, it will show that the PDF has a fast web view in properties. There is an article explaining this in more detail.

 

Access a Linearized PDF file (PDF Viewer examples)

If you are using the JPedal Java PDF Viewer, all the work is done for you. If you open a file as a URL, JPedal will open the file and check to see if it is Linearized, popping up the display as soon as the Linearized part has loaded.

 

New Linearized file functionality in PdfDecoder class

The following methods are new of changes in version 4.10

 

Example code for using linearization with PdfDecoder in your own code

If you are using the PDFDecoder object and wish to use Linearization, there is sample java code showing how to access it in the example Commands file.

 

Viewing other pages in a PDF Linearized file

Acrobat is able to jump to any PDF page in a Linearized PDF file. Java does not have support for this flexiblity, so JPedal cannot jump to any page. However, JPedal is able to track which page data has now been loaded and display those pages. This is done automatically for you in our PDF Viewer. If you wish to add it to your own java code, here is how to see if the PDF page is available.

//if loading on linearized thread, see if we can actually display
//if OS version or non-linearized or linearized and loaded, always returns true
if(!decode_pdf.isPageAvailable(pageNumber)){
	currentGUI.showMessageDialog("Page "+pageNumber+" is not yet loaded");
    return;
}

 

Return to main PDF support section

Click here for the main PDF support area with lots of java examples, PDF tutorials and useful information to get the most out of the JPedal PDF library

 


PDF viewer