Set image resolution

On this page

If the output PDF file contains images, you can reduce its resolution.

To allow changing the image resolution, set the CompressImages and ResizeImages properties to true. The GroupDocs.Viewer compresses all images in the file. The MaxResolution property determines the maximum resolution.

The following code snippet shows how to reduce image resolution in the file:

using GroupDocs.Viewer;
using GroupDocs.Viewer.Options;
using GroupDocs.Viewer.Domain.Documents.PostProcessing.Pdf.Optimization;
// ...

using (var viewer = new Viewer("sample.docx"))
    PdfViewOptions viewOptions = new PdfViewOptions();
    viewOptions.PdfOptimizationOptions = new PdfOptimizationOptions()
        CompressImages = true,
        ImageQuality = 50,
        ResizeImages = true,
        MaxResolution = 100

The following image demonstrates the result:

Set max resolution

On this page