Nutrient .NET SDK
Need pricing or implementation help? Talk to Sales.
PDF COMPRESSION IN C#
using GdPicturePDFReducer gdpicturePDFReducer = new GdPicturePDFReducer();
// Remove unused document content.gdpicturePDFReducer.PDFReducerConfiguration.RemoveAnnotations = true;gdpicturePDFReducer.PDFReducerConfiguration.RemoveBookmarks = true;gdpicturePDFReducer.PDFReducerConfiguration.RemoveMetadata = true;gdpicturePDFReducer.PDFReducerConfiguration.RemoveBlankPages = true;
// Optimize fonts and document structure.gdpicturePDFReducer.PDFReducerConfiguration.PackFonts = true;gdpicturePDFReducer.PDFReducerConfiguration.PackDocument = true;
// Run the compression process.gdpicturePDFReducer.ProcessDocument(@"C:\temp\source.pdf", @"C:\temp\output.pdf");using GdPicturePDFReducer gdpicturePDFReducer = new GdPicturePDFReducer();
// Recompress images at a target resolution and quality.gdpicturePDFReducer.PDFReducerConfiguration.RecompressImages = true;gdpicturePDFReducer.PDFReducerConfiguration.DownscaleImages = true;gdpicturePDFReducer.PDFReducerConfiguration.DownscaleResolution = 200;gdpicturePDFReducer.PDFReducerConfiguration.ImageQuality = PDFReducerImageQuality.ImageQualityHigh;
// Run the compression process.gdpicturePDFReducer.ProcessDocument(@"C:\temp\source.pdf", @"C:\temp\output.pdf");using GdPicturePDFReducer gdpicturePDFReducer = new GdPicturePDFReducer();
// Enable MRC hyper-compression for mixed-content documents.gdpicturePDFReducer.PDFReducerConfiguration.EnableMRC = true;gdpicturePDFReducer.PDFReducerConfiguration.DownscaleResolutionMRC = 200;gdpicturePDFReducer.PDFReducerConfiguration.RecompressImages = true;
// Run the compression process.gdpicturePDFReducer.ProcessDocument(@"C:\temp\source.pdf", @"C:\temp\output.pdf");USE CASES
Large PDF archives consume expensive storage and slow down file transfers. The SDK removes redundant data, downscales images, and packs fonts to reduce file size without manual intervention.
Scanned PDFs tend to be large because they store images rather than text. MRC hyper-compression segments each page into layers and applies the best algorithm to each, cutting file sizes dramatically.
High-resolution images embedded in PDFs are a common source of bloat. Downscale to a target DPI, apply JPEG2000 or JBIG2 compression, and control quality per document — all in a few lines of C#.
Documents served over the web benefit from linearization, which restructures PDFs so pages load incrementally as they download. Enable it with a single configuration flag.
Remove unnecessary content and optimize document structure. Pack fonts and the document itself to eliminate redundant data.
Recompress existing images in a PDF at a lower resolution and configurable quality level. The target DPI and quality are set independently.
Apply JBIG2 for bitonal images and JPEG2000 for color and grayscale. Automatic color detection picks the right scheme without manual configuration.
Mixed raster content compression segments pages into text, graphics, and image layers, and then applies the optimal algorithm to each independently.
ADVANCED CAPABILITIES
The SDK exposes 30+ configuration parameters. Stack techniques — remove content, recompress images, apply MRC, and linearize in a single compression pass. Multicore parallelization processes pages concurrently without any extra code.
Combine content removal, image recompression, font packing, MRC, and linearization in a single compression pass — all controlled through one configuration object.
The SDK allocates threads dynamically based on available CPU resources, speeding up compression of large documents and batch jobs.
Choose the output PDF version and conformance level, or retain the existing version of the source document.
All compression features are available in VB.NET with the same API surface. The guides include complete code examples in both C# and VB.NET.
Install the Nutrient .NET SDK, configure the compression settings, and point the optimizer at the source and output file paths. You can combine techniques — remove content, recompress images, pack fonts — in a single pass. See the compression guide for complete C# examples.
Mixed raster content (MRC) compression segments each page into layers — text, graphics, and background images — and applies the optimal algorithm to each. It’s most effective for documents that mix text and images, such as scanned contracts, reports with charts, or invoices. See the MRC guide.
Configure the SDK to recompress existing images at a target resolution and quality level. You control both the target DPI and image quality independently. Reducing unnecessarily high image resolution is one of the most effective ways to cut file size without visible quality loss.
JBIG2 is designed for bitonal (black-and-white) images and achieves very high compression ratios on scanned text. JPEG2000 is suited for 24-bit color and 8-bit grayscale images, offering better quality than standard JPEG at the same file size. Enable color detection to let the SDK choose automatically.
Enable linearization in the configuration before running the optimizer. Linearization restructures the PDF so a viewer can display the first page before the rest of the file has finished downloading — useful for large documents served over the web.
The SDK can remove annotations, bookmarks, metadata, embedded files, form fields, hyperlinks, JavaScript, blank pages, and page thumbnails — each controlled independently. Content removal is fast and often produces meaningful size reductions on its own.
Yes. Parallel processing is on by default. The SDK dynamically allocates threads based on available CPU resources, so batch compression jobs scale without additional configuration.
Yes. All compression features are available in VB.NET with the same options. The compression guide includes complete code examples in both C# and VB.NET.
FREE TRIAL
Start compressing PDFs in C# in minutes — 30+ optimization parameters, no payment information required.