Click or drag to resize
Pdf Library for .NET

PdfAnnotationElement Class

Represents a text-note (sticky) annotation in a pdf document. Viewers display the icon at the given rectangle; clicking the icon opens a popup showing the annotation text.
Inheritance Hierarchy
SystemObject
  SelectPdf.UniversalPdfPageElement
    SelectPdf.UniversalPdfAnnotationElement

Namespace: SelectPdf.Universal
Assembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.4
Syntax
public class PdfAnnotationElement : PdfPageElement

The PdfAnnotationElement type exposes the following members.

Constructors
 NameDescription
Public methodPdfAnnotationElement(RectangleF, String) Constructs a text annotation element.
Public methodPdfAnnotationElement(Single, Single, Single, Single, String) Convenience overload — creates the annotation from explicit x / y / width / height values.
Top
Properties
 NameDescription
Public propertyActualText Gets or sets the exact text represented by this element (the structure element's /ActualText entry), used when the drawn glyphs do not map to readable text.
(Inherited from PdfPageElement)
Public propertyAlternateText Gets or sets the alternate text describing this element for assistive technology (the structure element's /Alt entry). Required on figures for PDF/UA conformance.
(Inherited from PdfPageElement)
Public propertyArtifact Gets or sets a value indicating whether this element is an artifact — decorative or layout content that carries no meaning and is excluded from the logical structure (backgrounds, rules, running headers). Takes precedence over TagType.
(Inherited from PdfPageElement)
Public propertyIcon Gets or sets the icon displayed by viewers when the annotation is collapsed. Default: Note.
Public propertyOpen Gets or sets whether the annotation popup is initially open when the document is rendered. Default: false (collapsed to its icon).
Public propertyRectangle Gets or sets the annotation rectangle in the pdf page.
Public propertyTagType Gets or sets the structure type used to tag this element in a tagged (accessible) document. Ignored unless the document's tagged mode (PdfDocument.Tagged) is enabled. Null (default) leaves the element untagged unless Artifact is set.
(Inherited from PdfPageElement)
Public propertyText Gets or sets the annotation text.
Top
Example
PdfDocument document = new PdfDocument();
PdfPage page = document.AddPage();
PdfAnnotationElement note =
    new PdfAnnotationElement(20, 20, 20, 20, "Review this section.");
note.Icon = PdfAnnotationIcon.Comment;
page.Add(note);
document.Save("out.pdf");
document.Close();
See Also