Set resolution of document preview.

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Annotation MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-annotation -- dnx GroupDocs.Annotation.Mcp --yes
Folders, licensing and more →

On this page

GroupDocs.Annotation v21.5 and later allows you to set resolution of the document’s preview. By default, it is 96 points per inch. Set the Resolution property of the PreviewOptions class to change the resolution.

The following code snippets shows how to set preview resolution to 144 PPI:

using (Annotator annotator = new Annotator("input.pdf"))
{
    PreviewOptions previewOptions = new PreviewOptions(pageNumber =>
    {
        var pagePath = $"result_{pageNumber}.png";
        return File.Create(pagePath);
    })
    {
        // Set resolution
        Resolution = 144
    };

    annotator.Document.GeneratePreview(previewOptions);
}

On this page