Remove annotation from document
Leave feedback
On this page
GroupDocs.Annotation allows you to remove all previously added annotations. To do this, follow these steps:
- Instantiate the Annotator class. Specify the input document path or stream.
- Instantiate the SaveOptions class. Set
AnnotationTypes = AnnotationType.None
. - Call the Save method. Specify the output document path or stream.
The following code snippet shows how to remove annotation using its index:
using (Annotator annotator = new Annotator("result.xlsx"))
{
annotator.Remove(0);
annotator.Save("removed.xlsx");
}
The following code snippet shows how to remove annotation using the object:
using (Annotator annotator = new Annotator("result.xlsx"))
{
var tmp = annotator.Get();
annotator.Remove(tmp[0]);
annotator.Save("removed.xlsx");
}
The following code snippet shows how to remove annotations using list of indexes:
using (Annotator annotator = new Annotator("result.xlsx"))
{
var idList = new List<int>{1, 2, 3};
annotator.Remove(idList);
annotator.Save("removed.xlsx");
}
The following code snippet shows how to remove some annotations from document using list of objects:
using (Annotator annotator = new Annotator("result.xlsx"))
{
var tmp = annotator.Get();
annotator.Remove(tmp);
annotator.Save("removed.xlsx");
}
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.