Show / Hide Table of Contents

# Class Text

A text annotation represents a 'sticky note' attached to a point in the PDF document. When closed, the annotation shall appear as an icon; when open, it shall display a pop-up window containing the text of the note in a font and size chosen by the conforming reader. Text annotations shall not scale and rotate with the page; they shall behave as if the NoZoom and NoRotate annotation flags.

##### Inheritance

object
Annot
Markup
Text

##### Implements

IDisposable

##### Inherited Members

Markup.GetTitle()
Markup.SetTitle(string)
Markup.GetPopup()
Markup.SetPopup(Popup)
Markup.GetOpacity()
Markup.SetOpacity(double)
Markup.GetSubject()
Markup.SetSubject(string)
Markup.GetCreationDates()
Markup.SetCreationDates(Date)
Markup.GetBorderEffect()
Markup.SetBorderEffect(Markup.BorderEffect)
Markup.GetBorderEffectIntensity()
Markup.SetBorderEffectIntensity(double)
Markup.GetInteriorColor()
Markup.GetInteriorColorCompNum()
Markup.SetInteriorColor(ColorPt, int)
Markup.GetContentRect()
Markup.SetContentRect(Rect)
Markup.GetPadding()
Markup.SetPadding(Rect)
Markup.RotateAppearance(double)
Annot.GetTriggerAction(Annot.EventType)
Annot.Create(SDFDoc, Annot.Type, Rect)
Annot.op_Assign(Annot)
Annot.Equals(object)
Annot.IsValid()
Annot.GetSDFObj()
Annot.GetType()
Annot.IsMarkup()
Annot.GetRect()
Annot.GetVisibleContentBox()
Annot.SetRect(Rect)
Annot.GetContents()
Annot.SetContents(string)
Annot.GetPage()
Annot.SetPage(Page)
Annot.GetUniqueID()
Annot.SetUniqueID(string)
Annot.GetDate()
Annot.SetDate(Date)
Annot.GetFlag(Annot.Flag)
Annot.SetFlag(Annot.Flag, bool)
Annot.GetBorderStyle()
Annot.SetBorderStyle(Annot.BorderStyle)
Annot.GetAppearance(Annot.AnnotationState, string)
Annot.GetAppearance(Annot.AnnotationState)
Annot.GetAppearance()
Annot.SetAppearance(Obj, Annot.AnnotationState, string)
Annot.SetAppearance(Obj, Annot.AnnotationState)
Annot.SetAppearance(Obj)
Annot.RemoveAppearance(Annot.AnnotationState, string)
Annot.RemoveAppearance(Annot.AnnotationState)
Annot.RemoveAppearance()
Annot.Flatten(Page)
Annot.GetActiveAppearanceState()
Annot.SetActiveAppearanceState(string)
Annot.GetColorAsRGB()
Annot.GetColorAsCMYK()
Annot.GetColorAsGray()
Annot.GetColorCompNum()
Annot.SetColor(ColorPt)
Annot.SetColor(ColorPt, int)
Annot.GetStructParent()
Annot.SetStructParent(int)
Annot.GetOptionalContent()
Annot.SetOptionalContent(Obj)
Annot.Resize(Rect)
Annot.GetRotation()
Annot.SetRotation(int)
Annot.RefreshAppearance(RefreshOptions)
Annot.RefreshAppearance()
Annot.GetCustomData(string)
Annot.SetCustomData(string, string)
Annot.DeleteCustomData(string)
Annot.Dispose()
object.ToString()
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.MemberwiseClone()

###### Namespace: pdftron.PDF.Annots

###### Assembly: PDFNet.dll

##### Syntax

    public class Text : Markup, IDisposable

### Constructors

#### Text(Annot)

Creates a Text annotation and initialize it using given annotation object.

##### Declaration

    public Text(Annot mku)

##### Parameters

Type | Name | Description
--- | --- | ---
Annot | mku | the annot

##### Remarks

The constructor does not copy any data, but is instead the logical equivalent of a type cast.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### Text(Obj)

Creates a Text annotation and initialize it using given Cos/SDF object.

##### Declaration

    public Text(Obj d)

##### Parameters

Type | Name | Description
--- | --- | ---
Obj | d | the d

##### Remarks

The constructor does not copy any data, but is instead the logical equivalent of a type cast.

### Methods

#### Create(SDFDoc, Rect)

Creates a new Text annotation, in the specified document.

##### Declaration

    public static Text Create(SDFDoc doc, Rect pos)

##### Parameters

Type | Name | Description
--- | --- | ---
SDFDoc | doc | A document to which the annotation is added.
Rect | pos | A rectangle specifying the annotation's bounds, specified in user space coordinates.

##### Returns

Type | Description
--- | ---
Text | A newly created blank Text annotation.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### Create(SDFDoc, Rect, string)

Creates a new Text annotation, in the specified document.

##### Declaration

    public static Text Create(SDFDoc doc, Rect pos, string contents)

##### Parameters

Type | Name | Description
--- | --- | ---
SDFDoc | doc | A document to which the annotation is added.
Rect | pos | A rectangle specifying the annotation's bounds, specified in user space coordinates.
string | contents | The text contents of the Text annotation.

##### Returns

Type | Description
--- | ---
Text | A newly created Text annotation.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### Dispose(bool)

##### Declaration

    [HandleProcessCorruptedStateExceptions]
    protected override void Dispose(bool A_0)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | A_0 |

##### Overrides

Markup.Dispose(bool)

#### ~Text()

##### Declaration

    protected ~Text()

#### GetAnchorPosition()

Returns anchor point position (in relative coordinates) - the point that won't move when the page is zoomed in/out Anchor point position is in relative coordinates [0,1], and default is upper-left corner (0,1)

##### Declaration

    public Point GetAnchorPosition()

##### Returns

Type | Description
--- | ---
Point | Currently stored anchor position or the default (upper-left corner (0,1))

#### GetIcon()

Gets the Icon type as an entry of the enum "Icon".

##### Declaration

    public Text.Icon GetIcon()

##### Returns

Type | Description
--- | ---
Text.Icon | An entry of "Icon" that represents the type of icon that is corresponding with this Text annotation.

##### Remarks

The icon type represnets the name of an icon that shall be used in displaying the annotation. Conforming readers shall provide predefined icon appearances for at least the following standard icon types: e_Comment, e_Key, e_Note, e_Help, e_NewParagraph, e_Paragraph, e_Insert Additional names may be supported as well. Default value: e_Note. The annotation dictionary's Appearance(AP) entry, if present, shall take precedence over this Name entry.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetIconName()

Gets the string indicating the type of icon corresponding to the Text annotation.

##### Declaration

    public string GetIconName()

##### Returns

Type | Description
--- | ---
string | A string that represents the type of icon that is corresponding with this Text annotation.

##### Remarks

the icon type represnets the name of an icon that shall be used in displaying the annotation. Conforming readers shall provide predefined icon appearances for at least the following standard icon types: e_Comment, e_Key, e_Note, e_Help, e_NewParagraph, e_Paragraph, e_Insert Additional names may be supported as well. Default value: Note. The annotation dictionary's Appearance(AP) entry, if present, shall take precedence over this Name entry.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetState()

Gets the string indicating the state of the Text annotation.

##### Declaration

    public string GetState()

##### Returns

Type | Description
--- | ---
string | A string that represents the state of the Text annotation.

##### Remarks

The state is a state to which the original annotation shall be set. Default: 'Unmarked' if StateModel is 'Marked'; 'None' if StateModel is 'Review'.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetStateModel()

Gets the string indicating the state model of the Text annotation.

##### Declaration

    public string GetStateModel()

##### Returns

Type | Description
--- | ---
string | A string that represents the state model of the Text annotation.

##### Remarks

The State model is the state model corresponding to the State entry;

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### IsOpen()

Gets the initial openning condition of the Text annotation.

##### Declaration

    public bool IsOpen()

##### Returns

Type | Description
--- | ---
bool | A bool indicating whether the Text annotation is initially open.

##### Remarks

this Open option is a flag specifying whether the annotation shall initially be displayed open. Default value: false.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetAnchorPosition(Point)

Sets anchor point position (in coordinates relative to the annotation Rect) - the point that won't move when the page is zoomed in/out and/or if the page is rotated.

##### Declaration

    public void SetAnchorPosition(Point pt)

##### Parameters

Type | Name | Description
--- | --- | ---
Point | pt | Anchor point position in relative coordinates [0,1], where 0,0 is bottom left corner of the annotation, and 1,1 is top right corner. Default: 0,1

#### SetIcon(string)

Sets the string indicating the type of icon corresponding to (Optional).

##### Declaration

    public void SetIcon(string icon)

##### Parameters

Type | Name | Description
--- | --- | ---
string | icon | A string that represents the type of icon that is corresponding with this Text annotation.

##### Remarks

the icon type represnets the name of an icon that shall be used in displaying the annotation. Conforming readers shall provide predefined icon appearances for at least the following standard icon types: e_Comment, e_Key, e_Note, e_Help, e_NewParagraph, e_Paragraph, e_Insert Additional names may be supported as well. Default value: Note. The annotation dictionary's Appearance(AP) entry, if present, shall take precedence over this Name entry.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetIcon(Icon)

Sets the Icon type as an entry of the enum "Icon". (Optional)

##### Declaration

    public void SetIcon(Text.Icon icon)

##### Parameters

Type | Name | Description
--- | --- | ---
Text.Icon | icon | An entry of "Icon" that represents the type of icon that is corresponding with this Text annotation.

##### Remarks

the icon type represnets the name of an icon that shall be used in displaying the annotation. Conforming readers shall provide predefined icon appearances for at least the following standard icon names: Comment, Key, Note, Help, NewParagraph, Paragraph, Insert Additional names may be supported as well. Default value: e_Note. The annotation dictionary's Appearance(AP) entry, if present, shall take precedence over this Name entry.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetOpen(bool)

Sets the initial openning condition of the Text annotation. (Optional)

##### Declaration

    public void SetOpen(bool isopen)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | isopen | A bool indicating whether the Text annotation is initially open.

##### Remarks

this Open option is a flag specifying whether the annotation shall initially be displayed open. Default value: false.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetState(string)

Sets the string indicating the state of the Text annotation. (Optional; PDF 1.5 )

##### Declaration

    public void SetState(string state)

##### Parameters

Type | Name | Description
--- | --- | ---
string | state | A string that represents the state of the Text annotation.

##### Remarks

The state is a state to which the original annotation shall be set. Default: 'Unmarked' if StateModel is 'Marked'; 'None' if StateModel is 'Review'.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetStateModel(string)

Sets the string indicating the state model of the Text annotation. (Required if State is present, otherwise optional; PDF 1.5 )

##### Declaration

    public void SetStateModel(string statemodule)

##### Parameters

Type | Name | Description
--- | --- | ---
string | statemodule | A string that represents the state model of the Text annotation.

##### Remarks

The State model is the state model corresponding to the State entry;

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

### Implements

IDisposable