We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Syncfusion Feedback


Trusted by the world’s leading companies

Overview

The Syncfusion Essential PDF is a .NET Core PDF library used to optimize or compress PDF documents. Reducing the PDF file size can help you optimize bandwidth cost, network transmission, and digital storage. It is especially useful in areas like archiving or long-term preservation, emailing, and using PDF documents in web-based applications. The Syncfusion .NET Core PDF library will work seamlessly regardless of the document structure and content to compress PDF with just a few lines of C# code. Files can be resized according to the requirement.


PDF compression techniques

Shrink or compress images

PDF files may contain many images. Removing the images from a PDF file is usually not an option as they are necessary for PDFs. Downsampling the images will decrease the number of pixels and is possibly the most effective way to reduce the PDF file size. Users can control the PDF file size with respect to the quality of the image.

Optimize fonts

Font resources will also result in large file sizes. To make the PDF smaller, remove unused glyphs and unwanted font tables from the embedded font in the PDF document.


Remove annotations

Removing or flattening annotations can help reduce your file size. Flattening will remove annotations, but preserve its values. It will only be used when no further editing is needed.

Optimize page content

Optimizing the page content will remove unwanted commented lines, white spaces, convert end-of-line characters to spaces, and compress all uncompressed contents.


Disable incremental updates

The content of a PDF file can be updated incrementally without rewriting the entire file. Changes are appended to the end of the file, leaving its original content intact. Disabling the incremental update will rewrite the entire file, which results in a smaller PDF.

Remove form fields

Removing or flattening form fields can help reduce your file size. Flattening will remove the form fields and preserve its values. It will only be used when no further editing is needed.


Remove metadata

Reduce the file size by removing the metadata in the PDF document.


Compress PDF code example

The .NET Core PDF library used to compress PDF documents with just a few lines of code.

//Load the existing PDF document
PdfLoadedDocument loadedDocument = new PdfLoadedDocument(inputStream);
//Create a new compression option
PdfCompressionOptions options = new PdfCompressionOptions();
//Enable the compress image and set image quality. 
options.CompressImages = true;
options.ImageQuality = 50;
//Assign the compression option to the document
loadedDocument.CompressionOptions = options;
FileStream fileStream = new FileStream("CompressedPDF.pdf", FileMode.CreateNew, FileAccess.ReadWrite);
loadedDocument.Save(fileStream); //Save the compressed document to file stream 
loadedDocument.Close(true); //Close the document

Other features of optimize or compress PDF



Awards

Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion is proud to hold the following industry awards.

Scroll up icon