Rendering to PNG or JPEG

Image Viewer provides PngViewOptions and JpgViewOptions classes to set specific options for rendering the document into desired image format.

Here are the steps for rendering documents into image with GroupDocs.Viewer API:

Rendering to PNG

This example shows how to render each document page into PNG image.

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

Rendering to JPEG

This example shows how to render each document page into JPG image.

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

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