ViewAnyFile Logo
ViewAnyFileClient-Side File Studio

🗜️ Compress PDF Online Free

Reduce PDF file size by removing unused objects and optimising structure. No upload — processed entirely in your browser using pdf-lib.

🔒 Files never leave your device⚡ Instant🆓 Free forever
📄

Drop a PDF here or click to browse

How PDF Compression Works Here

This tool uses pdf-lib to re-serialise your PDF with useObjectStreams: true. This removes duplicated cross-reference entries, unused object definitions, and redundant metadata — typically reducing file size by 10–40% without any quality loss on text or vector content.

Note: Image-heavy PDFs where images are already compressed (e.g. scanned documents saved as JPEG) will see smaller gains. For maximum compression on image-heavy PDFs, the images themselves would need to be re-encoded at lower quality — a feature coming soon.

Why Compress PDFs?

  • Email attachments often have size limits (10–25 MB)
  • Uploading to government portals or job application forms
  • Faster loading on mobile and slow connections
  • Saving storage space in archives or cloud drives

Under the Hood: How ISO 32000-1 PDF Object Stream Optimization Works

A Portable Document Format (`.pdf`) file is not a flat sequence of pages — it is an indexed graph of indirect objects (font descriptors, XObject image streams, annotation dictionaries, and incremental edit trailers) linked by a byte-offset Cross-Reference (`xref`) table. Whenever a PDF is edited, signed, or annotated in desktop software, new objects are appended to the end of the file while obsolete revisions remain trapped in the binary payload.

ViewAnyFile.app’s PDF Compressor parses the document’s internal object graph locally in browser RAM using `pdf-lib` and performs three structural optimizations:

  • Orphaned Object Garbage Collection: By traversing the active `/Root` catalog and `/Pages` tree, our engine copies only live referenced pages into a fresh PDF container, automatically discarding dead incremental-save trailers and orphaned metadata dictionaries.
  • Compressed Object Streams (`ObjStm`): Rather than writing hundreds of verbose plain-text indirect object headers (`12 0 obj ... endobj`) with an uncompressed ASCII `xref` table, the serializer packs non-stream objects into compressed PDF 1.5+ Object Streams (`useObjectStreams: true`) using lossless `FlateDecode` (zlib/DEFLATE).
  • Vector & Typography Preservation: Because structural compression operates on the PDF object graph rather than rasterizing pages to blurry JPEGs, selectable text, vector CAD linework, and hyperlinks remain 100% crisp.

When to Combine Structural Compression with Page Extraction

If your PDF contains dozens of high-resolution scanned pages and you only need to submit specific sections (such as the signature pages of a contract or a single chapter of a manual), combining our PDF Splitter with this compressor yields the largest possible byte reduction. You can also inspect the final document in our PDF Technical Viewer.