Set JPEG images quality

When rendering documents to PDF format that contains JPG images it may be reasonable to reduce size of the output file by adjusting quality of the JPG images. GroupDocs.Viewer enables you to adjust quality of images in the output PDF document with JpgQuality setting of PdfViewOptions class. The supported values range of JpgQuality is from 1 to 100. Default value is 90.

The following steps are to be followed in order to set image quality.

The following code sample shows how to adjust JPG image quality in the output PDF document.

using (Viewer viewer = new Viewer("sample.docx"))
{               
    PdfViewOptions viewOptions = new PdfViewOptions();
    viewOptions.JpgQuality = 50;
    viewer.View(viewOptions);
}

© Aspose Pty Ltd 2001-2022. All Rights Reserved.