How to check if a PDF file is Linearized in JPedal?

Firstly, if you are unsure on what Linearized PDF files are, I would recommend you read this article describing what Linearized PDF files are.

Essentially, they are a layout used for PDF files which allows initial pages to be loaded while the rest of the file is still being downloaded. It saves you from having to wait for the full file to be downloaded to be able to view the first page of a PDF file.

How can we check in JPedal?

We have a method in the PdfUtilities class that will return true if the PDF file is Linearized. Below is an example of the code.

final PdfUtilities extract = new PdfUtilities(filename);
if (extract.openPDFFile()) {
final boolean isLinearized = extract.isPDFLinearized();

Can JPedal modify PDF files to be Linearized?

No. The best Linearized PDF files are those that are Linearized on creation by the creation tools that support them. Although it is technically possible to linearize a PDF file after it has been created, JPedal does not support it.

Still need help? Send us your questions.