Delete Annotations (facades)

Delete All Annotations from an Existing PDF File

PdfAnnotationEditor allows you delete all the annotations from the existing PDF file. First off, create a PdfAnnotationEditor object and bind input PDF file using BindPdf method. After that, call DeleteAnnotations method to delete all the annotations from the file, and then use Save method to save the updated PDF file. The following code snippet shows you how to delete all the annotations from the PDF file.

Delete All Annotations by Specified Type

You can use PdfAnnotationEditor class to delete all the annotations, by a specified annotation type, from the existing PDF file. In order to do that you need to create a PdfAnnotationEditor object and bind input PDF file using BindPdf method. After that, call DeleteAnnotations method, with the string parameter, to delete all the annotations from the file; the string parameter represents the annotation type to be deleted. Finally, use Save method to save the updated PDF file. The following code snippet shows you how to delete all annotations by specified annotation type.

Delete an Annotation by Specified Name

You can use the PdfAnnotationEditor class to delete a specific annotation, by its unique name, from an existing PDF file. In order to do that, you need to create a PdfAnnotationEditor object and bind input input PDF file using the BindPdf method. After that, call the DeleteAnnotation method, passing the name of the annotation to delete. Finally, use the Save method to store the updated PDF file. The following code snippet shows you how to delete an annotation by its name.