GdPicture.NET is a Nutrient product. Learn more

.NET PDF optimization SDK

Reduce PDF file size in C# using adaptive compression algorithms, font optimization, image analysis, and MRC hyper-compression. Remove unused objects, recompress images, merge fonts, and linearize documents for faster web loading. Supports 100+ file formats.



PDF compression techniques in C#

Combine multiple compression algorithms to overcome limitations of single-method approaches. Remove unused objects, compress content streams, and generate optimized object streams — each configurable based on document type.


  • Remove unused objects
  • Compress content streams
  • Generate object streams
PDF compression techniques

PDF content removal

Remove redundant, unwanted, or unused objects to reduce file size. Selectively strip elements that add bloat without affecting document integrity:


  • Blank page
  • JavaScript
  • Metadata
  • Thumbnails
  • Form fields
  • Annotations
  • Bookmarks
  • Embedded files
  • Hyperlinks
  • Page-piece contents
PDF content removal

PDF image compression

Optimize embedded images — often the largest component of PDF file size. Automatically recompress and downscale images while preserving visual quality.


  • Automatic image recompression
  • High-quality image downscaling
  • Manage compression schemes: Zlib/deflate, CCITT, JBIG2, JPEG, JPEG 2000
PDF image compression

MRC hyper-compression

Advanced compression using mixed raster content (MRC) technology. Segment images by content type, and apply optimal compression algorithms to each region.


  • Color detection for automatic image classification
  • Mixed raster content compression (MRC)
  • JBIG2 pattern matching and substitution (PM&S)
  • JPEG 2000 encoding quality control
  • JBIG2 PM&S sensitivity adjustment
MRC hyper-compression

PDF font optimization

Reduce font data size while ensuring consistent rendering across all platforms and devices. Embedded fonts — mandatory in modern PDF standards — are optimized using multiple techniques.


  • Font data stream compression
  • Font subsetting (include only used glyphs)
  • Font data table reduction
  • Font merging (combine duplicate fonts)
PDF font optimization

PDF linearization and repair

Optimize document structure for faster loading and improved readability — especially for large files delivered over the web.


  • Fast Web View (linearization) for progressive PDF loading
  • Character repair for improved text rendering
PDF linearization and repair

PDF optimization use cases

Configure optimization settings based on your document workflow. Enable or disable features to match industry requirements, compliance needs, or internal processes.

Electronic document exchange

Prioritize small file size and linearization for fast loading, viewing, and sharing over networks.

Document archiving

Maximize compression while preserving required resolution. Remove redundant content to save storage space.

Prepress and print

Maintain high resolution, color accuracy, and transparency for professional print reproduction.

Demo

Try PDF hyper-compression live

Upload a document and test MRC compression in your browser.

get started

How to use

Download and install the GdPicture.NET package to access compiled demo applications and multi-language sample projects with full source code.

Explore demo apps
Find compiled demo applications in \Samples\Bin\.
Explore source code
Find an example of a full application (the source code of PDF reducer) in \Samples\DotNet\GdPicture.NET 14\WinForm\C#\PDF Reducer.
Visit reference guide
Explore other code snippets within the online reference guide.

Example of usage

The example shows how to optimize a PDF document.

using GdPicturePDFReducer gdpicturePDFReducer = new GdPicturePDFReducer();
// Configure the metadata of the resulting PDF document.
gdpicturePDFReducer.PDFReducerConfiguration.Author = "Nutrient .NET PDF Reducer SDK";
gdpicturePDFReducer.PDFReducerConfiguration.Producer = "GdPicture.NET 14";
gdpicturePDFReducer.PDFReducerConfiguration.ProducerName = "Nutrient";
gdpicturePDFReducer.PDFReducerConfiguration.Title = "PDF Optimization";
// Specify the version and the conformance level of the output PDF document.
gdpicturePDFReducer.PDFReducerConfiguration.OutputFormat = PDFReducerPDFVersion.PdfVersionRetainExisting;
// Configure the compression process by removing document elements.
gdpicturePDFReducer.PDFReducerConfiguration.RemoveAnnotations = true;
gdpicturePDFReducer.PDFReducerConfiguration.RemoveBlankPages = true;
gdpicturePDFReducer.PDFReducerConfiguration.RemoveBookmarks = true;
gdpicturePDFReducer.PDFReducerConfiguration.RemoveEmbeddedFiles = true;
gdpicturePDFReducer.PDFReducerConfiguration.RemoveFormFields = true;
gdpicturePDFReducer.PDFReducerConfiguration.RemoveHyperlinks = true;
gdpicturePDFReducer.PDFReducerConfiguration.RemoveJavaScript = true;
gdpicturePDFReducer.PDFReducerConfiguration.RemoveMetadata = true;
gdpicturePDFReducer.PDFReducerConfiguration.RemovePageThumbnails = true;
// Optimize the output file size by packing fonts.
gdpicturePDFReducer.PDFReducerConfiguration.PackFonts = true;
// Optimize the output file size by packing the document.
gdpicturePDFReducer.PDFReducerConfiguration.PackDocument = true;
// Run the compression process.
gdpicturePDFReducer.ProcessDocument(@"C:\temp\source.pdf", @"C:\temp\output.pdf");

Learn more about PDF optimization

Download our technical article on PDF compression techniques, originally presented at PDF Day France 2018, an educational conference organized by the PDF Association.


Trusted by 3,000+ customers and Fortune 500 companies

15Y+
More than 15 years of experience developing our SDK
10K+
Trusted by more than 10,000 developers


Frequently asked questions

What techniques does the GdPicture.NET PDF optimization SDK employ to reduce PDF file sizes?

The SDK utilizes a combination of advanced compression algorithms and optimization strategies, including:

  • Content removal — Eliminating unnecessary elements such as blank pages, JavaScript, metadata, thumbnails, form fields, annotations, bookmarks, embedded files, and hyperlinks.
  • Image compression — Applying automatic image recompression and high-quality downscaling, and managing compression schemes like Zlib/deflate, CCITT, JBIG2, JPEG, and JPEG 2000.
  • Font optimization — Streamlining embedded fonts to reduce redundancy and file size.
  • Data compression — Compressing content streams and generating object streams to enhance overall efficiency.
  • Advanced image analysis — Implementing color detection and mixed raster content (MRC) compression to balance quality and compression rates effectively.

These techniques collectively contribute to significant reductions in PDF file sizes.

Can the SDK selectively apply optimization features based on specific requirements?

Yes. The GdPicture.NET PDF optimization SDK is highly customizable. Developers can enable or disable individual optimization features to tailor the process according to specific document contexts and requirements. This flexibility ensures that only the desired optimizations are applied, preserving essential content while reducing file size.

How does the SDK handle image content during the optimization process?

The SDK offers robust image processing capabilities, including:

  • Automatic image recompression — Recompressing images to more efficient formats without compromising quality.
  • High-quality downscaling — Reducing image resolution to balance quality and file size appropriately.
  • Compression scheme management — Supporting various compression methods such as Zlib/deflate, CCITT, JBIG2, JPEG, and JPEG 2000 to optimize images effectively.

These features ensure that images within PDFs are optimized for minimal file size while maintaining visual fidelity.

Is the GdPicture.NET PDF optimization SDK suitable for large-scale document processing?

Absolutely. The SDK is designed to handle batch processing efficiently, making it ideal for large-scale document management tasks. Its advanced optimization algorithms and customizable features allow for the processing of extensive document collections, ensuring significant storage savings and improved document handling performance.

What are the typical use cases for implementing the GdPicture.NET PDF optimization SDK?

The SDK is versatile and applicable across various scenarios, including:

  • Electronic document exchange — Reducing file sizes for faster transmission and reduced bandwidth usage.
  • Document archiving — Optimizing PDFs for long-term storage, in turn conserving space while preserving content integrity.
  • Prepress preparation — Streamlining PDFs for printing processes by removing unnecessary elements and compressing content.
  • Customized optimization — Applying specific optimization settings tailored to unique organizational needs or document types.

These use cases demonstrate the SDK’s capability to enhance efficiency and performance in various PDF handling applications.

60-day free trial

Try GdPicture.NET now!