Mark Stephens Mark founded the company and has worked with Java and PDF since 1997. The original creator of the core code, he is also a NetBeans enthusiast who enjoys speaking at conferences and reading. He holds an Athletics Blue and an MA in Mediaeval History from St. Andrews University.

What is a Linearized PDF?

4 min read

(PDF logo)

(PDF logo)

A linearized PDF (sometimes spelled linearised) is an ordinary PDF with its objects rearranged so that everything needed to draw the first page comes at the start of the file. Opened over the web, page one can appear while the rest is still downloading. Acrobat calls this Fast Web View.

Linearization has been part of the format since PDF 1.2, and Annex F of the PDF specification (ISO 32000) sets out how the file has to be laid out. Besides moving page one to the front, it adds a hint table that tells the viewer where each of the other pages starts, so it can ask the server for just those bytes.

What are Linearized PDF files?

In general, the PDF is a very elegant and well-designed format. A PDF consists of lots of PDF objects which are used to create the pages. This information is stored in a binary tree which also stores the location of each object in the file.

So only the tree needs to be loaded when the file is opened, and it can then be used to load the required objects to display a page.

The whole file itself does not need to be read, only the tree. The location of the tree is always stored at the end of the file so it is easy to find and also simple to modify the file just by appending new information and a new tree.

However, if the file is read via the web, it is accessed as a stream of bytes. This means the reference (which is at the end of the file) cannot be read until the whole PDF file has been transferred. This can take some time with large files.

How to create a Linearized PDF

So Adobe created a new way to layout the PDF called Linearized PDF. The file format is still the same, but there is a special tag at the start of the file and all the objects needed to create the first page (and a mini binary tree describing them) are stored at the START of the file.

As soon as this data has been read, the first page can be displayed, while the rest of the file is downloaded. This makes the whole thing seem much faster and gives the user something to look at almost immediately even on huge files.

What is the difference between linearized PDF and non-linearized PDF

Linearized PDF are used to organize internal components in an ordered, page-by-page basis which helps in enhancing web viewing experience by allowing users to view the most desired pages as quickly as possible.

Whereas non-linearized PDF have objects scattered across the entire file and need to be fully downloaded before viewing.

Feature Linearized PDF Non-Linearized PDF
Page Access (Web) First page can be viewed immediately, even before full file download Must download entire file before any page is viewable
Organization Data arranged page-by-page with first-page content and index at file start Objects and page data scattered throughout the file
Web Streaming Support Optimized for streaming and progressive rendering Not optimized; requires full file for access
Use Case Ideal for large PDFs shared or viewed online Better suited for small, local, or offline files
User Experience Faster initial load, better performance on slow networks Slower loading, especially for large documents

How to check if a PDF is linearized?

In Adobe Acrobat and Adobe Reader, the best way to see if a PDF is Linearized is to look at the Document properties. If the file is a linearized PDF, the item Fast Web View will display ‘Yes’.

In JPedal PDF Viewer, we have added a similar option so show if the file is Linearized to the Document properties. If it is Linearized, the word linearized appears in the general section after the PDF version.

and the Java code to see if a PDF file is linearized…

In JPedal you can also check programmatically to see if a file is Linearized by seeing if the Linearized object exists – if it does it is a Linearized PDF.

 

How to linearize a PDF in Java with JPedal

Since the 2026.11 release, JPedal can write linearized PDF files as well as read them. Which method to use depends on whether you only want to linearize a file, or are already changing it with JPedal.

Linearize an existing PDF file

The PDF Optimizer linearizes a file in one call when you pass it the LINEARIZE optimization. The input file is left untouched.

If the input file is password protected, pass the password as well:

LINEARIZE can be combined with the other optimizations, and is always applied after them.

Linearize a PDF while editing it

If you are already changing the file with the PDF Manipulator, call setLinearizeDocument(true) before writing it.

This applies to all of the writeDocument() methods, including those which encrypt the output with a password.

Linearize a PDF from the command line

java -cp jpedal.jar org.jpedal.tools.PdfOptimizer --linearize inputFile.pdf outputFile.pdf

You can confirm the output is linearized with the isPDFLinearized() check above, or by looking for Fast Web View in Adobe Acrobat. There is more detail in How to Linearize a PDF file.

When should you linearize a PDF?

If a PDF is going on a website, linearize it. Manuals, datasheets, reports and scanned archives are the files people click on and then sit waiting for, and the bigger the file or the slower their connection, the more difference it makes.

On a local disk you won't notice anything. The whole file is already there, so the viewer reads the cross-reference table at the end and goes straight to the page it needs. Linearizing won't make a file smaller either. That's compression, which is a separate job.

Don't bother linearizing a draft that's still going to change. Adding annotations, saving a filled-in form or signing the file in most editors appends an incremental update to the end, and from then on the hint table no longer matches the file, so viewers go back to treating it as an ordinary PDF. Linearize the final version once the edits are done.

A signature gets saved as one of those incremental updates too, and linearizing again after signing rewrites the file and breaks the signature. For a PDF that has to be signed, you'll usually have to give up Fast Web View.

FAQs

Q: Can linearized PDFs be created or optimized using free tools?

A: Yes. Free and open-source tools such as qpdf (--linearize) and Ghostscript (-dFastWebView with the pdfwrite device) can write linearized PDF files.

Q: Does linearizing a PDF affect the file size or quality?

A: Linearization reorders the objects in the file and adds a small hint table, so on its own it does not change quality and adds little to the file size. The tool doing the rewrite can still change the size, for example by compressing or decompressing streams while it writes the file.

Q: Are linearized PDFs compatible with all PDF viewers and browsers?

A: Most modern PDF viewers and browsers support linearized PDFs, but some older or specialized viewers might not fully utilize the optimized streaming capabilities.

Q: How do I linearize a PDF in Java?

A: Use JPedal's PdfOptimizer with the LINEARIZE optimization, or call setLinearizeDocument(true) on the PdfManipulator before writing the file. Both are available from JPedal 2026.11.

Q: Does a linearized PDF stay linearized after it is edited?

A: Not necessarily. Edits saved as an incremental update are appended to the end of the file, so the first page data and hint tables no longer describe the whole file and viewers treat it as a normal PDF. Linearize the file again after editing it, for example by writing it with setLinearizeDocument(true) in JPedal.

Q: Does fast web view need any support from the web server?

A: The first page can be shown as the file streams in, but jumping to other pages before the download has finished needs the server to support HTTP byte-range requests. Most web servers and CDNs support them for static files.

Q: Which PDF version is needed for a linearized PDF?

A: Linearization was added in PDF 1.2. When JPedal linearizes an older file it raises the version in the header to 1.2, and encrypted output is always written as PDF 2.0 because it uses AES-256 encryption.



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


Mark Stephens Mark founded the company and has worked with Java and PDF since 1997. The original creator of the core code, he is also a NetBeans enthusiast who enjoys speaking at conferences and reading. He holds an Athletics Blue and an MA in Mediaeval History from St. Andrews University.