Linearize a PDF for Fast Web View

Linearizing a PDF, also called Fast Web View, rewrites the file so the objects needed to draw page one, plus a hint table, sit at the very start of the file. A web server that supports byte-range requests can then show the first page while the rest is still downloading. This tool runs qpdf, the reference open-source linearizer, compiled to WebAssembly, entirely in your browser.

Linearize PDF — runs on your device

How it works

A normal PDF is written back to front from a reader's point of view. The cross-reference table that says where every object lives sits at the end of the file, and the objects for page one can be scattered anywhere. A viewer therefore needs the last bytes of the file before it can find the first page, which is why an ordinary PDF on a slow connection shows nothing until the download finishes.

Linearization, defined in Annex F of the PDF specification (ISO 32000), reorders the file into a strict layout: a first-page cross-reference table, the document catalog, every object that page one references — its fonts, images, and content streams — and a hint table all come first, in the first contiguous run of bytes. The hint table records the byte offset and length of every remaining page, so once a viewer has the head of the file it can render page one immediately and then issue HTTP byte-range requests (Range: bytes=…) for exactly the pages the reader scrolls to, in any order, while the rest streams in the background. This only pays off when the web server answers range requests; served from disk or from a server that ignores ranges, a linearized file opens exactly like any other.

Producing this layout correctly is finicky — object numbers change, two cross-reference tables must agree, and the hint stream's offsets must be byte-exact — so this page does not reimplement it. It runs qpdf, the open-source tool that is the de facto reference implementation of linearization, compiled to WebAssembly. Your file is loaded into an in-memory filesystem, qpdf --linearize rewrites it, and the result is handed back to you as a download. The WebAssembly build is about 1.2 MB and is fetched once, the first time you use a qpdf-based tool; after that it is cached. No PDF data ever leaves your device.

Linearization is purely a byte-ordering transform: pages, fonts, bookmarks, links, and form fields all survive untouched, and the visual output is identical. If your goal is a smaller file rather than a faster first page, that is a different operation — the sibling web optimize tool repacks small objects into compressed object streams to cut structural overhead, and pairs well with linearization for files published online.

Worked example: a 48 MB brochure on a hotel website

A 96-page hotel brochure PDF, 48.2 MB with full-page photography, was linked from a booking page. On a 20 Mbit/s connection the full download takes roughly 19 seconds, and without linearization the in-browser viewer showed a blank pane for all of it. Running the file through this tool took about 6 seconds and produced a 48.3 MB output — 74 KB larger, the cost of the hint tables.

Served from the same nginx host (which answers byte-range requests by default), the first page — title, cover photo, two fonts, about 1.1 MB of objects — rendered in under two seconds. Jumping straight to the restaurant menu on page 61 fetched only that page's ranges, roughly 900 KB, instead of the 30 MB that precede it in the file. Acrobat's document properties confirmed Fast Web View: Yes, and qpdf --check reported the linearization data as valid. The visible content was pixel-identical before and after.

Frequently asked questions

What does it mean to linearize a PDF?

Linearization rewrites a PDF so the objects needed to display page one, plus a hint table describing where every other page lives, are placed at the start of the file. A viewer fetching the file over HTTP can then render the first page from the first chunk of bytes instead of waiting for the whole download. The page content itself is unchanged.

How do I check if a PDF has Fast Web View enabled?

Open the file in Adobe Acrobat or Acrobat Reader and look at File, Properties, Description, where Fast Web View shows Yes or No. On the command line, qpdf --check reports whether the file is linearized and whether the linearization data is valid. Files saved by most browsers and office suites are not linearized by default.

Does linearizing a PDF make the file smaller?

Not meaningfully, and sometimes the file grows by a few kilobytes because of the added hint tables. Linearization changes the order of objects, not their compression, so it speeds up first-page display rather than shrinking the download. To reduce size, compress the images or repack the object streams instead.

Why is my linearized PDF still slow to open on my website?

Fast Web View only helps when the web server honors HTTP byte-range requests and the viewer takes advantage of them. If the server sends the whole file regardless, or the PDF is delivered through a proxy or CDN that strips range support, the viewer must still buffer everything. Check that responses include the Accept-Ranges header.

Does linearization change how the PDF looks or remove anything?

No. Every page, font, image, bookmark, and form field is preserved; only the physical order of objects in the file and the cross-reference structure change. The output renders identically to the input in any viewer. Encrypted files keep their encryption.

Is this the same as web-optimizing a PDF?

The terms overlap but the operations differ. Linearization reorders objects for byte-range streaming, while the web optimize tool on this site repacks small objects into compressed object streams to shrink structural overhead. They are complementary: one helps first-page latency, the other total download size.

Related tools