Remove annotation from document

GroupDocs.Annotation provides an ability to remove all previously added annotations from document and save cleaned document as it was before annotating.
There are the steps to remove annotations from document:

  • Instantiate Annotator object with input document path or stream;
  • Instantiate SaveOptions object and set AnnotationTypes = AnnotationType.None;
  • Call save method with resultant document path or stream and SaveOptions object;

The following code demonstrates how to remove annotation from document:

Annotator annotator = new Annotator("C://input.pdf");
SaveOptions saveOptions = new SaveOptions();
saveOptions.setAnnotationTypes(AnnotationType.None);"C://output.pdf", saveOptions);

More resources

Advanced Usage Topics

To learn more about document annotating features, please refer to the advanced usage section.

GitHub Examples

You may easily run the code above and see the feature in action in our GitHub examples:

Free Online App

Along with full-featured Java library we provide simple, but powerful free Apps.
You are welcome to annotate your PDF, DOC or DOCX, XLS or XLSX, PPT or PPTX, PNG and other documents with free to use online GroupDocs Annotation App.