Skip to content
ComPDF
DemoSampleAPI ReferenceFAQ
New Release

Open-Source PDF SDK & AI Document Processing

Get the full self-hosted SDK and AI document processing on GitHub. One-click deploy to quickly build your document workflows.

Delete Annotations

The steps to delete an annotation are as follows:

  1. Obtain the page object where the annotation needs to be deleted.

  2. Access the list of annotations on that page.

  3. Locate the desired annotation in the annotation list.

  4. Delete the identified annotation.

This example shows how to delete annotations:

C#
// Get the page object for which annotations need to be deleted.
CPDFPage page = document.PageAtIndex(0);
// Get the list of annotations for this page.
List<CPDFAnnotation> annotList = page.GetAnnotations();
// Find the annotation to be deleted in the list and remove it.
annotList[0].RemoveAnnot();