Render original page size

When rendering PDF documents in JPG and PNG formats by default GroupDocs.Viewer calculates output image size for better rendering quality. In case you want to make output JPG and PNG images to be the same size in pixels as the size of pages in a source PDF document GroupDocs.Viewer provides a new option called RenderOriginalPageSize of the PdfOptions class.

The following code snippet shows how to convert pages to the same size as the size of pages in a source document (This example can be also found in our public GitHub repository.)

using (Viewer viewer = new Viewer("sample.pdf"))
{
    PngViewOptions viewOptions = new PngViewOptions();
    viewOptions.PdfOptions.RenderOriginalPageSize = true;

    viewer.View(viewOptions);
}