Skip to main content
All docs
V23.2

PdfPageFacade.AddTextAnnotation(PdfPoint, String) Method

Adds a text annotation at the specified point on the page.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Pdf.v23.2.Core.dll

NuGet Package: DevExpress.Pdf.Core

Declaration

public PdfTextAnnotationFacade AddTextAnnotation(
    PdfPoint point,
    string iconName
)

Parameters

Name Type Description
point PdfPoint

The point on the page to position the text annotation.

Optional Parameters

Name Type Default Description
iconName String "Note"

The name of the annotation icon.

Returns

Type Description
PdfTextAnnotationFacade

An object that contains text annotation properties.

Example

The code sample below creates a sticky note at the specified point on the first page:

using (PdfDocumentProcessor processor = new PdfDocumentProcessor())
{
  // Load a document
  processor.LoadDocument("..\\..\\Document.pdf");

  // Access the first page properties
  PdfPageFacade page = processor.DocumentFacade.Pages[0];

  // Add sticky note at the specified point
  PdfTextAnnotationFacade textAnnotation =
     page.AddTextAnnotation(new PdfPoint(64, 65), PdfTextAnnotationIconName.Cross);

  // Specify annotation parameters
  textAnnotation.Author = "Nancy Davolio";
  textAnnotation.Color = new PdfRGBColor(0.8, 0.2, 0.1);
  textAnnotation.Contents = "Please proofread this document";
}
See Also