FreeTextAnnotation

FreeTextAnnotation

Overview

FreeTextAnnotation is a class in Aspose.PDF FOSS for .NET. Inherits from: MarkupAnnotation.

This class provides 18 methods for working with FreeTextAnnotation objects in .NET programs. Available methods include: Accept, ChangeAfterResize, ClearState, Clone, FindStateAnnotation, Flatten, FreeTextAnnotation, GetRectangle, GetState, GetStateModel, MarkupAnnotation, SetMarkedState, and 4 additional methods. All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package. Properties: Action, Actions, ActiveState, Alignment, AnnotationFlags, AnnotationState, and 54 more.

Properties

NameTypeAccessDescription
DefaultAppearancestring?Read/WriteThe /DA default-appearance string.
DefaultAppearanceObjectDefaultAppearanceReadThe strongly-typed default-appearance object backing DefaultAppearance.
DefaultStylestring?Read/WriteInline default rich-text style carried in /DS.
RichTextstring?Read/WriteRich text string (XHTML) for the annotation (/RC entry).
AnnotationTypeAnnotationTypeReadAlways FreeText.
CalloutPoint[]?Read/WriteCallout polyline (/CL entry, PDF 32000 §12.5.6.6 — Free text).
JustificationJustificationRead/WriteJustification of the rendered text (/Q: 0=Left, 1=Center, 2=Right).
IntentFreeTextIntentRead/WriteFree-text intent (/IT — FreeTextCallout / FreeTextTypeWriter).
StartingStyleLineEndingRead/WriteStarting line-ending style (/LE first entry; callout intent only).
EndingStyleLineEndingRead/WriteEnding line-ending style (/LE second entry; callout intent only).
RotateAspose.Pdf.RotationRead/WritePage-rotation of the rendered text (/Rotate).
TextRectangleRectangle?Read/WriteInner text rectangle (/RD inset from /Rect).
TextStyleTextStyleRead/WriteBundled text style (font / size / colour / alignment) applied when rendering the rich-text contents.
CreationDateSystem.DateTimeRead/WriteCreation timestamp recorded in /CreationDate.
OpacitydoubleRead/WriteOpacity (0..1) carried in /CA.
PopupPopupAnnotation?Read/WriteAssociated popup annotation (/Popup).
ReplyTypeReplyTypeRead/WriteReply relationship to InReplyTo (/RT).
Subjectstring?Read/WriteSubject line (/Subj).
Titlestring?Read/WriteAuthor / title carried in /T.
RectRectangle?Read/WriteThe annotation rectangle (position on page).
WidthdoubleRead/WriteThe width of the annotation rectangle.
HeightdoubleRead/WriteThe height of the annotation rectangle.
ActiveStatestring?Read/WriteCurrently-active appearance state (/AS entry).
AlignmentTextAlignmentRead/WriteText alignment (for free-text / widget annotations carrying rich text).
HorizontalAlignmentAspose.Pdf.HorizontalAlignmentRead/WriteHorizontal alignment, exposed in addition to Alignment; the two are independently settable.
TextHorizontalAlignmentAspose.Pdf.HorizontalAlignmentRead/WriteText-specific horizontal alignment override.
AppearanceAppearanceDictionaryReadAppearance dictionary (/AP entry) — keyed by appearance stream name (N, D, R).
StatesAppearanceDictionaryReadAppearance-state dictionary (the per-state sub-dict of AP/N, e.g.
NormalAppearanceXForm?ReadThe annotation’s normal (/AP /N) appearance as an XForm, or null when it has none.
UpdateAppearanceOnConvertboolRead/WriteWhether to regenerate the appearance stream when the annotation is saved into a converted document.
UseFontSubsetboolRead/WriteWhether the embedded font (if any) should be subsetted.
Contentsstring?Read/WriteThe annotation contents (text).
BorderBorder?Read/WriteAnnotation border.
ColorColorRead/WriteThe annotation border color (/C entry).
InteriorColorColor?Read/WriteThe annotation interior color (/IC entry, for circle/square/line annotations).
Namestring?Read/WriteThe annotation name (unique identifier — the /NM entry).
FullNamestring?ReadFully-qualified annotation name.
ModifiedDatestring?ReadThe modification date.
ModifiedDateTimeRead/WriteThe /M (modified) date as a typed DateTime.
FlagsAnnotationFlagsRead/WriteAnnotation flags (/F entry) — used as the storage backing for both the int and typed forms.
AnnotationFlagsAnnotationFlagsRead/WriteTyped alias of Flags exposing AnnotationFlags as a property.
ActionPdfAction?Read/WriteThe action associated with this annotation (/A entry).
ActionsPdfActionCollectionReadCollection of actions associated with this annotation.
Authorstring?ReadThe annotation author (/T entry).
AnnotationStatestring?ReadThe annotation state (/State entry), e.g.
AnnotationStateModelstring?ReadThe annotation state model (/StateModel entry), e.g.
InReplyToAnnotation?Read/WriteThe annotation this one is replying to (/IRT entry).
QuadPointsPoint[]Read/WriteQuadPoints as an array of Point values.
CharacteristicsCharacteristicsReadAppearance characteristics (border color, background color, rotation).
PageIndexintRead1-based index of the page that owns this annotation.
PagePage?ReadThe page that owns this annotation, or null when it can’t be resolved (e.g.
VerticalAlignmentVerticalAlignmentRead/WriteVertical alignment applied to this paragraph.
MarginMarginInfo?Read/WriteOuter-margin info applied to this paragraph.
IsFirstParagraphInColumnboolRead/WriteForce the paragraph to start a new column.
IsKeptWithNextboolRead/WriteKeep this paragraph on the same page as the next one.
IsInNewPageboolRead/WriteForce the paragraph to start on a new page.
IsInLineParagraphboolRead/WriteInline paragraph flag (does not start a new line).
HyperlinkTextstring?Read/WriteLegacy string-typed hyperlink target.
HyperlinkHyperlink?Read/WriteTyped hyperlink decoration applied to the paragraph.
ZIndexintRead/WriteZ-order index used by the DOM renderer.

Methods

SignatureDescription
FreeTextAnnotation(page: Page, rect: Rectangle, appearance: DefaultAppearance)Create a new FreeTextAnnotation with a default appearance.
FreeTextAnnotation(document: Document, appearance: DefaultAppearance)Document-bound ctor for creating a FreeTextAnnotation that isn’t yet attached to a specific page; the caller adds it via page.Annotations.Add(annot).
SetTextStyle(textStyles: RichTextFontStyles, fontName: string, fontSize: double, fontColor: System.Drawing.Color)Apply a font/size/colour bundle to the whole rich-text run.
SetTextStyle(fromInd: int, toInd: int, textStyles: RichTextFontStyles)Apply rich-text style flags to a substring (fromInd..toInd inclusive).
Accept(visitor: AnnotationSelector)Calls Accept on this FreeTextAnnotation instance.
MarkupAnnotation(document: Document)Document-bound ctor for creating a markup annotation that isn’t yet attached to a specific page; callers add it later via page.Annotations.Add(annot).
GetState()Read the /State entry on the annotation’s properties dictionary.
GetStateModel()Read the /StateModel entry, mapping the missing /entry to Undefined.
SetMarkedState(marked: bool)Set /State to Marked or Unmarked plus /StateModel = Marked.
SetReviewState(state: AnnotationState)Set the review state.
ClearState()Remove any recorded /State and /StateModel.
FindStateAnnotation()Find the state-tracking annotation linked to this markup (the most-recent /IRT reply annotation that carries a /State entry, per PDF 32000 §12.5.6.3).
GetRectangle(considerRotation: bool)Bounding rectangle adjusted by considerRotation.
ChangeAfterResize(transform: Matrix)Adjust the annotation’s geometry after the user resized the page or the host rectangle.
UpdateAppearances()Regenerate the normal appearance stream (/AP /N) from the annotation’s current geometry and colours.
WriteXfdf(writer: System.Xml.XmlWriter)Serialize this annotation as an XFDF element to writer (PDF 32000 §12.7.8 / XFDF 3.0).
Flatten()Flatten this annotation — render its visual appearance into the page content and remove it from the page’s annotations array.
Clone()Shallow clone — copies scalar/ref-shared state.

See Also