Skip to main content
.NET Framework 4.5.2+

PdfDocumentProcessor.GetMarkupAnnotationData(Int32) Method

Retrieves all text markup annotations from a page in a PDF document.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Docs.v22.1.dll

Declaration

public IList<PdfMarkupAnnotationData> GetMarkupAnnotationData(
    int pageNumber
)

Parameters

Name Type Description
pageNumber Int32

The number of a page where the markup annotations are located.

Returns

Type Description
IList<PdfMarkupAnnotationData>

The annotations retrieved from a page.

Remarks

The GetMarkupAnnotationData method returns all annotations on the page. Use the PdfMarkupAnnotationDataExtensions class methods to retrieve the specified type of annotations.

Example

The code sample below changes the markup style for annotations made by a specific author and changes the icon for all text annotations:

image

using DevExpress.Pdf;
using System;
using System.Collections.Generic;
//...
private static void EditAnnotations(PdfDocumentProcessor processor)
{
    //Retrieve annotations made by the specified author:
    var textMarkups =
        processor.GetMarkupAnnotationData(1).
        Where(annotation => annotation.Author.Contains("Cardle Anita L"));
    foreach (PdfMarkupAnnotationData markup in textMarkups)
    {
        //Get all text markup annotations from the retrieved list:
        PdfTextMarkupAnnotationData pdfTextMarkup =
         markup.AsTextMarkupAnnotation();
        if (pdfTextMarkup != null)
            //Change the annotation's markup type:
            pdfTextMarkup.MarkupType = PdfTextMarkupAnnotationType.Squiggly;
    }

    var annotations = processor.GetMarkupAnnotationData(1);
    foreach (PdfMarkupAnnotationData annotation in annotations)
    {
        //Get all text annotations:
        PdfTextAnnotationData textAnnotation = annotation.AsTextAnnotation();
        if (textAnnotation != null)

            //Change the annotation icon:
            textAnnotation.IconName = PdfTextAnnotationIconName.Note;
    }
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the GetMarkupAnnotationData(Int32) method.

Note

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