PdfMarkupAnnotation Class

A markup annotation (ISO 32000-2, 12.5.6.2): a note, a text markup, a free text, a stamp, a shape, an ink drawing... the annotations a reviewer adds to a document. Create them with the Add* methods of PdfAnnotationCollection.

public class PdfMarkupAnnotation : PdfAnnotation

Remarks

The markup annotations of the types the specification defines are instances of the derived classes (PdfTextAnnotation, PdfFreeTextAnnotation, PdfLineAnnotation, PdfSquareAnnotation, PdfCircleAnnotation, PdfPolygonAnnotation, PdfPolyLineAnnotation, PdfTextMarkupAnnotation, PdfStampAnnotation, PdfCaretAnnotation, PdfInkAnnotation, PdfRedactAnnotation); the sound annotations are instances of this class.

Inheritance
PdfAnnotation PdfMarkupAnnotation

Properties

NameDescription
AuthorGets or sets the author of the annotation (/T), which viewers show in the title bar of its pop-up window.
CreationDateGets or sets the date the annotation was created (/CreationDate).
InReplyToGets or sets the annotation this annotation is a reply to (/IRT), or null.
OpacityGets or sets the opacity of the annotation (/CA), from 0 to 1. The default is 1. The appearances the library creates are drawn with it.
PopupGets or sets the pop-up annotation that shows the text of this annotation (/Popup), or null.
ReplyTypeGets or sets the relationship with PdfMarkupAnnotation.InReplyTo (/RT). The default is PdfAnnotationReplyType.Reply.
RichContentsGets or sets the rich text of the annotation (/RC, 12.7.4.3): an XHTML fragment that viewers show instead of PdfAnnotation.Contents.
SubjectGets or sets the subject of the annotation (/Subj).

Gets or sets the author of the annotation (/T), which viewers show in the title bar of its pop-up window.

public string? Author { get; set; }

Property value

string?

Gets or sets the date the annotation was created (/CreationDate).

public DateTimeOffset? CreationDate { get; set; }

Property value

DateTimeOffset?

Gets or sets the annotation this annotation is a reply to (/IRT), or null.

public PdfAnnotation? InReplyTo { get; set; }

Property value

PdfAnnotation?

Exceptions

ArgumentException
The annotation belongs to another document.

Gets or sets the opacity of the annotation (/CA), from 0 to 1. The default is 1. The appearances the library creates are drawn with it.

public double Opacity { get; set; }

Property value

double

Exceptions

ArgumentOutOfRangeException
The value is not between 0 and 1.

Gets or sets the relationship with PdfMarkupAnnotation.InReplyTo (/RT). The default is PdfAnnotationReplyType.Reply.

public PdfAnnotationReplyType ReplyType { get; set; }

Gets or sets the rich text of the annotation (/RC, 12.7.4.3): an XHTML fragment that viewers show instead of PdfAnnotation.Contents.

public string? RichContents { get; set; }

Property value

string?

Gets or sets the subject of the annotation (/Subj).

public string? Subject { get; set; }

Property value

string?

Methods

NameDescription
GetReplies()Gets the replies to this annotation: the markup annotations of its page whose PdfMarkupAnnotation.InReplyTo is this annotation.

Gets the replies to this annotation: the markup annotations of its page whose PdfMarkupAnnotation.InReplyTo is this annotation.

public IReadOnlyList<PdfMarkupAnnotation> GetReplies()

Returns

IReadOnlyList<PdfMarkupAnnotation> The replies, in the order of the annotations of the page.