1. Home
  2. PDF
  3. Optimize PDF for Web

Optimize PDF for Web

Rearrange a PDF so a browser can show page one while the rest loads.

Runs in your browser · No upload
Linearizing only rearranges how objects are laid out in the file. Text, images and fonts are unchanged, and object streams are expanded into plain objects.

How to use

  1. Drop a PDF onto the box or click to choose one. Files up to 200 MB without a password are accepted.
  2. If a notice says the file carries a digital signature, linearizing will break that signature. Keep the original for documents that must stay signed.
  3. Press Optimize for web. The file is rewritten, then the result is structure-checked and reopened with a PDF viewer (pdf.js) to confirm the page count. Only then does the download button appear.
  4. Put the downloaded file on your web server. In Acrobat the document properties show Fast Web View: Yes, and poppler’s pdfinfo prints Optimized: yes.

What linearizing does

In an ordinary PDF the page list and the cross-reference table (xref) sit at the very end of the file, so a viewer has to read the end before it can show page one. A linearized PDF (Fast Web View) is reordered so that everything page one needs comes first. If the server answers partial requests, a viewer can fetch just the beginning, draw page one, and then ask for the byte range of any other page when it is needed. It is meant for long reports and catalogs published on the web.

Order Contents
1 Header and the linearization dictionary (file length, first-page location, page count)
2 First-page cross-reference table and trailer
3 Catalog and other objects needed to open the document
4 Hint stream (tables that say where each page and each shared object lives in the file)
5 First-page objects (page, text, images, fonts)
6 Objects of the other pages, objects shared between pages, and everything else
7 Main cross-reference table and trailer

This tool renumbers objects in that order and writes object streams out as plain objects. Text, image and font data are left alone. Objects nothing points to, and the small number objects that only held stream lengths, are dropped.

When it does not help

  • Small files: a PDF of a few pages downloads quickly either way.
  • Servers without range requests: if the server does not answer byte-range requests (Accept-Ranges: bytes), the viewer downloads the whole file before opening it, linearized or not.
  • Download then open: once the file is saved locally, the order no longer matters.
  • Viewers that ignore it: how much a viewer uses the linearization data varies. Most modern viewers need byte-range requests to benefit.

File size changes a little

Linearizing adds a hint stream and a second cross-reference table, so the file often grows slightly. Dropping unused objects can also shrink it. Examples measured with this tool:

Document Original Result Change
4-page sample made with pdf-lib 2,958 B 3,412 B +15.3%
93-page software manual 296,962 B 299,323 B +0.8%
27-page tax table document 397,806 B 390,398 B -1.9%

The fewer pages, the larger the hint tables look in percentage terms. To make a file smaller, use Compress PDF.

Things to know

  • Signed PDFs: a digital signature is computed over specific byte ranges of the file. Linearizing changes every byte offset, so the signature stops being valid. You are warned up front if a signature is present.
  • Encrypted PDFs: files with an open password and files with only an owner password are both refused. If you know the password, remove it first with Unlock PDF, then lock the linearized result again with Protect PDF.
  • Damaged PDFs: if a file cannot be read you are told why. Try Repair PDF first.
  • Unusual structures: files whose page tree loops or lists the same page twice are not linearized, and the reason is shown.
  • During development the same files were reopened with qpdf (pikepdf check_linearization), poppler pdfinfo, Ghostscript, pdf.js and pdf-lib to confirm that page counts and text match.

Frequently asked questions

Does a linearized PDF open faster than a normal one?

Only when the server supports byte-range requests and the viewer uses them, in which case page one shows before the rest has arrived. For small files, or servers that send the whole file at once, there is almost no difference.

How do I check that Fast Web View is on?

In Adobe Acrobat open the document properties (Ctrl+D) and look at Fast Web View. With poppler, pdfinfo file.pdf prints Optimized: yes; with qpdf, qpdf --check-linearization file.pdf checks the structure.

Why did the file get bigger?

The hint stream, the second cross-reference table and the expanded object streams add up. If the original packed its objects tightly into object streams, the growth can be larger. It is expected.

What happens if I linearize an already linearized PDF?

It is rebuilt normally and comes out nearly identical. You get a notice when the file already looks linearized.

Should I linearize a signed PDF?

No. The file bytes change, so the signature stops being valid. Keep the original, and check signature status with the PDF Signature Verifier.

Is my file uploaded?

No. Everything happens inside this browser.

Related tools: Compress PDF, Repair PDF, PDF Viewer, Merge PDF.

Your file is processed only in your browser and never sent to a server.

Can't find the tool you need?

Tell us what you want to do. We build the most requested tools first.