# Save specific page range This article demonstrates how to save specific page range when annotating documents using GroupDocs.Annotation for Java API. To export the specific page range, follow these steps: 1. Instantiate the [Annotator](https://reference.groupdocs.com/java/annotation/com.groupdocs.annotation/Annotator) class. Specify the input document path or stream. 2. Instantiate the [SaveOptions](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.options.export/saveoptions/) class. Call the [setFirstPage](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.options.export/saveoptions/#setFirstPage-int-) and  [setLastPage](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.options.export/saveoptions/#setLastPage-int-) methods to specify the first and the last pages. 3. Call the [save()](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation/annotator/#save--) method with the output document path or stream. Specify the [SaveOptions](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.options.export/saveoptions/) class as a parameter. The following code demonstrates how to save the range of document page: {{< tabs "example1">}} {{< tab "Java" >}} ```java // This example demonstrates saving result document with specified pages. // Create an instance of Annotator class Annotator annotator = new Annotator("inputPath"); try { SaveOptions tmp0 = new SaveOptions(); tmp0.setFirstPage(2); tmp0.setLastPage(4); // Save to file annotator.save(outputPath, tmp0); } finally { if (annotator != null) { annotator.dispose(); } } ``` {{< /tab >}} {{< /tabs >}}