PdfDocumentProcessor.GetMarkupAnnotationData(Int32) Method
Retrieves all text markup annotations from a page in a PDF document.
Namespace: DevExpress.Pdf
Assembly: DevExpress.Docs.v18.2.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.
To retrieve all text markup annotations in a page, call the PdfDocumentProcessor.GetMarkupAnnotationData
method.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-modify-an-existing-text-markup-annotation-t545429
Imports DevExpress.Pdf
Imports System
Imports System.Collections.Generic
Namespace ModifyExistingMarkupAnnotation
Friend Class Program
Shared Sub Main(ByVal args() As String)
' Create a PDF Document Processor.
Using processor As New PdfDocumentProcessor()
' Load a document.
processor.LoadDocument("..\..\Document.pdf")
' Get a list of annotations in the first document page.
Dim annotations As IList(Of PdfMarkupAnnotationData) = processor.GetMarkupAnnotationData(1)
If annotations.Count > 0 Then
' 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!")
End If
End Using
End Sub
End Class
End Namespace
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.