.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

PdfDocumentProcessor.DeleteMarkupAnnotations(IEnumerable<PdfMarkupAnnotationData>) Method

Deletes markup annotations specified in the PdfMarkupAnnotationData collection.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Docs.v21.1.dll

Declaration

public void DeleteMarkupAnnotations(
    IEnumerable<PdfMarkupAnnotationData> annotations
)

Parameters

Name Type Description
annotations IEnumerable<PdfMarkupAnnotationData>

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

Remarks

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

Example

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.

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.
                processor.LoadDocument("..\\..\\Document.pdf");

                // 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.
                    processor.DeleteMarkupAnnotations(annotations);

                    // Save the result document.
                    processor.SaveDocument("..\\..\\Result.pdf");
                }
            }
        }
    }
}
See Also