Save specific page range

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

To export the specific page range, follow these steps:

  1. Instantiate the Annotator class. Specify the input document path or stream.
  2. Instantiate the SaveOptions class. Specify the FirstPage and  LastPage parameters.
  3. Call the Save method with the output document path or stream. Specify the SaveOptions class as a parameter.

The following code demonstrates how to save the range of document page:

// for this example input document ("input.pdf") must have at least 4 pages
using (Annotator annotator = new Annotator("input.pdf"))
{
	//Result file will be contain only 3 pages (2, 3 and 4 page)
	annotator.Save("result.pdf", new SaveOptions { FirstPage = 2, LastPage = 4 });
}

On this page