Compress and optimize PDFs programmatically

Reduce PDF file size without losing document quality. Use advanced compression algorithms — including MRC hyper-compression, image optimization, and font subsetting — across server, desktop, and mobile platforms.

What do you want to optimize?

Reduce PDF file size

Compress PDFs by removing redundant data, optimizing images, and subsetting fonts.

Shrink scanned PDFs

Use MRC compression to shrink PDF documents that mix text, graphics, and images — without losing quality.

Optimize for fast web viewing

Linearize PDFs so they can be displayed page-by-page as they download over a network.

Strip unnecessary content

Remove annotations, bookmarks, blank pages, and metadata to minimize file size.

How we help


DOCUMENT ENGINE

Server-side PDF compression via REST API

Compress and optimize PDFs through a REST API. The compression engine removes redundant information and compresses data, with options for MRC hyper-compression, grayscale conversion, image quality control, and linearization.

PDF compression illustration in Document Engine environment
MRC hyper-compression

Reduces the size of documents that mix text, graphics, and images using image segmentation — without losing quality.


Image quality control

Set image optimization quality from 1 (lowest) to 4 (highest), or disable images entirely.


Grayscale conversion

Convert text, graphics, form fields, and annotations to grayscale to reduce file size.


Linearization

Optimize PDFs for efficient incremental access in a network environment — enabling fast web viewing.

.NET SDK

The most configurable PDF optimizer for desktop and server

An industry-leading compression engine that uses adaptive document learning and compression algorithms. Configure 25+ optimization parameters, including MRC, JBIG2, JPEG2000, color detection, font packing, and content removal.

PDF compression illustration in .NET environment
Advanced image compression

Enable MRC, JBIG2, and JPEG2000 compression with color detection for optimal per-image encoding.


Content removal

Remove annotations, bookmarks, blank pages, form fields, embedded files, and metadata to minimize file size.


Font optimization

Pack and subset fonts automatically during optimization to eliminate unused font data.


Image downscaling

Automatically downscale images and control quality settings, with options for resampling resolution.

IOS AND ANDROID

Mobile-optimized PDF saving

Reduce PDF file size on mobile by choosing between incremental saving (fast, appends changes) and full rewrite saving that removes unreferenced objects and optimizes the file structure.

PDF compression illustration on mobile devices
Rewrite and optimize

Use the rewriteAndOptimizeFileSize save option to fully rewrite the document structure, removing unreferenced objects.


Incremental vs. full save

Incremental saving is fast but grows file size over time. Switch to full rewrite when size matters.


Image size management

Reduce image dimensions before embedding to keep PDFs small for mobile rendering and transmission.






Frequently asked questions

How do I compress a PDF programmatically?

With Document Engine, send a POST request to the optimization endpoint with the optimize parameter. With the .NET SDK, use the GdPicturePDFReducer class to configure compression settings and run optimization. Both approaches process PDFs without manual intervention.

What is MRC compression?

Mixed raster content (MRC) compression separates a document into layers — text, graphics, and images — and compresses each layer with the most efficient algorithm. This reduces the size of scanned or image-heavy documents without losing visual quality. Available in Document Engine and the .NET SDK.

How do I optimize a PDF for fast web viewing?

Linearize the PDF so it can be displayed page-by-page as it downloads. Document Engine supports linearization via the REST API, and the .NET SDK offers it through the FastWebView property. Linearized PDFs are optimized for efficient incremental access in a network environment.

Can I achieve PDF file size reduction without losing quality?

Yes. Techniques like font subsetting, removing unused objects, and MRC hyper-compression reduce size while preserving visual fidelity. You can also control the tradeoff by setting image quality levels — from maximum compression to lossless preservation.

How do I compress scanned PDF documents?

Use MRC hyper-compression, which uses image segmentation to separate text from background and compress each layer independently. The .NET SDK also supports JBIG2 encoding for black-and-white content and color detection to apply the best codec per region.

What content can I remove to shrink a PDF?

The .NET SDK can remove annotations, bookmarks, blank pages, form fields, embedded files, JavaScript, and metadata. Document Engine supports flattening annotations into the page content. Removing unused content is one of the simplest ways to reduce file size.

How do I optimize PDF file size on iOS and Android?

Use the rewriteAndOptimizeFileSize save option instead of incremental saving. Incremental saving appends changes (which grows the file), while a full rewrite removes unreferenced objects and optimizes the file structure. For images, reduce their dimensions before embedding.

What compression algorithms does the .NET SDK support?

The .NET SDK supports mixed raster content, JBIG2 for bitonal images, JPEG2000 for high-quality lossy compression, and standard JPEG. It also includes color detection to automatically select the best algorithm for each image region, and it supports parallel processing for faster optimization.


FREE TRIAL

Ready to optimize your PDFs?

Start compressing and optimizing PDFs in minutes — no payment information required.


PDF compression SDK

What is a PDF compression SDK?

A PDF compression SDK lets developers programmatically reduce PDF file size by applying compression algorithms, removing redundant data, and optimizing document structure. Nutrient provides compression across multiple platforms — from server-side REST APIs to desktop and mobile SDKs.

  • Compresses images using MRC, JBIG2, and JPEG2000 algorithms.
  • Subsets and packs fonts to remove unused glyph data.
  • Removes annotations, bookmarks, and metadata.
  • Linearizes PDFs for fast web viewing.
  • Processes documents via REST API, .NET library, or mobile SDK.
How to choose the right PDF optimizer

When selecting a PDF optimization tool, consider your deployment environment, the types of documents you process, and how much control you need over compression settings.

  • Deployment model — Server API for automated pipelines, desktop SDK for maximum control, mobile SDK for on-device optimization.
  • Document types — Scanned documents benefit from MRC and JBIG2; text-heavy PDFs benefit from font subsetting and content removal.
  • Quality control — Look for configurable image quality levels and per-image compression algorithm selection.
  • Content removal — Evaluate which elements (annotations, bookmarks, metadata, blank pages) can be stripped.
When should I use MRC hyper-compression for PDF file size reduction?

MRC hyper-compression is most effective for structured documents that combine text, graphics, and images — such as scanned contracts, reports with charts, or mixed-content pages. It segments the document into layers and compresses each with the optimal algorithm, achieving significant file size reduction without visible quality loss.

What are the benefits of Nutrient’s PDF optimization?

Nutrient provides compression tools across server, desktop, and mobile platforms, so you can optimize PDFs wherever your application runs.

  • Multiplatform support — Document Engine (server), .NET SDK (desktop/server), iOS and Android SDKs (mobile).
  • Advanced algorithms — MRC, JBIG2, JPEG2000, color detection, and adaptive document learning.
  • Granular control — 25+ configurable parameters in the .NET SDK for fine-tuned optimization.
  • Linearization — Optimize for fast web viewing with incremental network access.
How does Nutrient compare to other PDF compression solutions?

Nutrient stands out with its breadth of compression algorithms and cross-platform availability. The .NET SDK offers one of the most configurable compression engines available, while Document Engine provides the same core optimization through a simple REST API.

  • Algorithm depth — Supports MRC, JBIG2, JPEG2000, and color detection where competitors may only offer basic compression.
  • Cross-platform — Same optimization capabilities available on server, desktop, and mobile.
  • Enterprise-proven — Trusted by Lufthansa, Disney, Autodesk, UBS, Dropbox, and IBM.