Skip to main content
.NET Framework 4.5.2+

PdfDocumentProcessor.DeleteMarkupAnnotations(IEnumerable<PdfMarkupAnnotationData>) Method

Deletes markup annotations specified in the PdfMarkupAnnotationData collection.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Docs.v23.1.dll


public void DeleteMarkupAnnotations(
    IEnumerable<PdfMarkupAnnotationData> annotations


Name Type Description
annotations IEnumerable<PdfMarkupAnnotationData>

A collection of PdfMarkupAnnotationData objects that represent text markup annotations that will be deleted.


To delete a specific markup annotation, call the PdfDocumentProcessor.DeleteMarkupAnnotation method.


This example shows how to delete all markup annotation from document pages.

To retrieve all text markup annotations in a page, call the PdfDocumentProcessor.GetMarkupAnnotationData method with a specified page number.

To delete all markup annotations, call the PdfDocumentProcessor.DeleteMarkupAnnotations method passing the markup annotation list as an argument to this method.

View Example

using DevExpress.Pdf;
using System.Collections.Generic;

namespace RemoveAllMarkupAnnotations {

    class Program {
        static void Main(string[] args) {

            // Create a PDF Document Processor.
            using (PdfDocumentProcessor processor = new PdfDocumentProcessor()) {

                // Load a document.

                // Get a list of annotations in the document pages.
                for (int i = 0; i <= processor.Document.Pages.Count; i++) {
                    IList<PdfMarkupAnnotationData> annotations = processor.GetMarkupAnnotationData(i);

                    // Delete all text markup annotations from document pages.

                    // Save the result document.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DeleteMarkupAnnotations(IEnumerable<PdfMarkupAnnotationData>) method.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also