Reduce PDF file size with PDF object compression

XFINIUM.PDF 8.2 brings support for PDF object compression.

This feature available in PDF 1.5 and higher lets you compress also the PDF file structure (compression of PDF objects) and not just the objects content.

The PDF object compression is activated when the ‘enableObjectCompression’ parameter in PdfDocument.Save method is set to true.

The code below shows how to create a PDF file with this feature enabled:

PdfFixedDocument document = new PdfFixedDocument();
document.PdfVersion = PdfVersion.Version15;
PdfPage page = document.Pages.Add();
// 2nd parameter set to true to enable PDF object compression.
document.Save("Sample_ObjectCompression.pdf", true);
Dim document As PdfFixedDocument = New PdfFixedDocument()
document.PdfVersion = PdfVersion.Version15
Dim page As PdfPage = document.Pages.Add()
' 2nd parameter set to true to enable PDF object compression.
document.Save("Sample_ObjectCompression.pdf", True)

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.