Skip to content
Optimize PDF for Web

How to optimize a PDF for the web (fast web view)

Updated

Contents

To optimize a PDF for the web, open Optimize PDF for Web, add the PDF and press Optimize on our secure server. It comes back linearized, the layout Adobe Acrobat calls Fast Web View. It is not compressed: its size can change in either direction, and Compress PDF is the tool for a smaller file.

In a linearized file, what the first page needs is moved to the front, with an index of where everything else is, so a viewer opening it from a link can show page one while the rest is still downloading. Our server does that with qpdf's --linearize option and nothing else, and there are no settings. Nothing on the pages changes: no image is downsampled and no text is touched. qpdf does rewrite the whole file, though: the index adds a little, while compressing streams that were stored uncompressed, or leaving out objects nothing uses any more, can make the file smaller.

The PDF, up to 100 MB, is uploaded to our secure server and deleted when the job ends. The download link stops working after 60 minutes.

Open Optimize PDF for Web

Step by step

  1. 1Drop your PDF on the box that says “Add a PDF, or”, or click browse to pick it. The tool takes one PDF at a time.
  2. 2Press Optimize on our secure server, which uploads the file over an encrypted connection. The button reads “Uploading your file…”, then “Waiting for our server…” if there is a queue, “Optimizing on our secure server…” while qpdf works, and “Downloading the result…”.
  3. 3Read the lines above the download. “Your web-optimized PDF is ready.” means it worked; the line under it says the file is linearized for fast web view and shows its size before and after.
  4. 4Press the button reading Download and the new name: catalogue.pdf comes back as catalogue-web-optimized.pdf. Save it before you reload the page; after a reload, run the job again.
  5. 5Put the optimized file where people open it, on your website or document portal, in place of the original.
Open Optimize PDF for Web

What linearizing does, and when it helps

An ordinary PDF keeps its index of objects at the end, so a viewer opening it from a link has to fetch the end of the file before it can draw anything. A linearized PDF puts the first page's objects and a hint table at the front, so a viewer that asks a server for parts of a file can draw page one early and fetch other pages as they are opened.

That helps only when both sides take part: a viewer that requests byte ranges, as browser PDF viewers can, and a web server that answers them. An email attachment is downloaded whole before it opens, and a file on your own disk can be read in any order already, so neither gains anything.

Optimize for the web, or compress?

They answer different questions. Compress PDF makes the file smaller: a lossless repack in your browser, and deep image compression on our secure server, which lowers the resolution of the pictures. Optimize PDF for Web makes no picture smaller and does not aim at size at all; it changes the order of what is in the file, and its size can move in either direction.

For a PDF that is both heavy and read on the web, do both, in that order: compress first, then optimize the compressed copy. A later rewrite by another program generally throws the linearized layout away again. If the optimized file comes out larger than the original, the page says so and points to Compress PDF.

Checking the result, and files that fail

To check a file yourself, open it in Adobe Acrobat or Reader and look at File › Properties: Fast Web View should read Yes. From a command line, qpdf --check-linearization yourfile.pdf reports whether the linearization data is valid. Our server also checks that the file it made is linearized before handing it back, and one that is not ends in a failed job, not a download.

A file that asks for a password before it opens fails, because there is no password field here; remove the password with Unlock PDF first. A file cut off before its end-of-file marker, as an interrupted download is, is refused as damaged: run it through Repair PDF and optimize the repaired copy. When qpdf works around smaller damage, its warnings are listed above the download.

Common questions

Does optimizing a PDF for the web make it smaller?

Not reliably, and that is not what it is for. Linearizing reorders the file and adds an index, and the whole file is rewritten, so its size can change in either direction. To make a PDF smaller, use Compress PDF.

Will my PDF open faster for everyone?

Only for readers who open it from a web server in a viewer that requests parts of the file and a server that answers such requests. Opened as an email attachment or from a disk, it opens as fast as before.

How do I check that a PDF has Fast Web View?

In Adobe Acrobat or Reader, open File › Properties and look for Fast Web View: Yes. Or run qpdf --check-linearization yourfile.pdf from a command line.

Can I optimize a digitally signed PDF?

Not without breaking the signature. Linearizing rewrites the whole file, so the bytes a certificate signature covers no longer match and it stops validating. Linearize the unsigned version and sign it last; then check the signed copy, because signing adds data at the end of the file and a viewer may no longer report it as linearized.

What happens to my file after the job?

It is uploaded over an encrypted connection and deleted from our server when the job ends, whether it succeeds or not. The download link stops working after 60 minutes, and a daily storage rule erases the stored copy after that.

Tools used in this guide

All tools