PdfDocumentProcessor.GetMarkupAnnotationData(Int32) Method
Retrieves all text markup annotations from a page in a PDF document.
Namespace: DevExpress.Pdf
Assembly: DevExpress.Docs.v19.1.dll
Declaration
Parameters
Name | Type | Description |
---|---|---|
pageNumber | Int32 | An integer value that specifies the number of a page where the markup annotations are located. |
Returns
Type | Description |
---|---|
IList<PdfMarkupAnnotationData> | A collection of PdfMarkupAnnotationData objects that represent markup annotation data in a page. |
Remarks
The GetMarkupAnnotationData method returns only text markup annotation data in a page
Example
This example shows how to change an existing markup annotation’s settings in a PDF document.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-modify-an-existing-text-markup-annotation-t545429
using DevExpress.Pdf;
using System;
using System.Collections.Generic;
namespace ModifyExistingMarkupAnnotation
{
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 first document page.
IList<PdfMarkupAnnotationData> annotations = processor.GetMarkupAnnotationData(1);
if (annotations.Count > 0) {
// Change the properties of the first annotation.
annotations[0].Author = "Bill Smith";
annotations[0].Contents = "Important!";
annotations[0].Color = new PdfRGBColor(0.6, 0.7, 0.3);
annotations[0].Opacity = 0.2;
// Save the result document.
processor.SaveDocument("..\\..\\Result.pdf");
}
else
Console.WriteLine("The specified document page does not contain markup annotations!");
}
}
}
}
Related GitHub Examples
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.