# Extract annotations from document This page describes how to extract annotations from document when collaborate, edit and annotate documents using GroupDocs.Annotation for Java. [GroupDocs.Annotation](https://products.groupdocs.com/annotation/java) allows you to extract annotations from a document and serialize them to the XML format. To do this, 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 [LoadOptions](https://reference.groupdocs.com/java/annotation/com.groupdocs.annotation/Annotator) class and set `ImportAnnotation = true`. 3. Define a variable of the `List` type. 4. Call the [get()](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation/annotator/#get--) method to get result to variable defined on the previous step. 5. Instantiate the `XmlSerializer` class with the `List` type. 6. Using `FileStream` object, serialize annotations to the file. The following code snippet shows how to extract annotations from a document: {{< tabs "example1">}} {{< tab "Java" >}} ```java // for using this example input file ("annotated.pdf") must have annotations LoadOptions loadOptions = new LoadOptions(); // Create an instance of Annotator class Annotator annotator = new Annotator("annotated.pdf", loadOptions); // Get all annotations List annotations = annotator.get(); ``` {{< /tab >}} {{< /tabs >}}