# Class: TextAnnot

## PDFNet. TextAnnot

#### new TextAnnot()

  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 do not scale and rotate with the page (i.e. they should behave as if the NoZoom and NoRotate annotation flags).

### Methods

#### <static> create(doc, pos)

  Constructor

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `doc` | PDFNet.SDFDoc |
  `pos` | PDFNet.Rect |

  ##### Returns:

  A promise that resolves to an object of type: "TextAnnot"

  Type
    PDFNet.TextAnnot

#### <static> createAtPoint(doc, pos)

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `doc` | PDFNet.SDFDoc |
  `pos` | PDFNet.Point |

  ##### Returns:

  A promise that resolves to an object of type: "TextAnnot"

  Type
    PDFNet.TextAnnot

#### <static> createFromAnnot(ann)

  creates a Text annotation and initializes it using given annotation object.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `ann` | PDFNet.Annot | Annot object used to initialize the Text annotation.

  ##### Returns:

  A promise that resolves to an object of type: "TextAnnot"

  Type
    PDFNet.TextAnnot

#### <static> createFromObj(d)

  creates a Text annotation and initializes it using given Cos/SDF object.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `d` | PDFNet.Obj | The Cos/SDF object to initialze the annotation with.

  ##### Returns:

  A promise that resolves to an object of type: "TextAnnot"

  Type
    PDFNet.TextAnnot

#### getIcon()

  Returns the type of the icon associated with the Text annotation.

  ##### Returns:

  A promise that resolves to a value of the enumeration type "Icon". Default value: e_Note.

  Type
    number

  ##### Example

      Return value enum:
      <pre>
      PDFNet.TextAnnot.Icon = {
      	e_Comment : 0
      	e_Key : 1
      	e_Help : 2
      	e_NewParagraph : 3
      	e_Paragraph : 4
      	e_Insert : 5
      	e_Note : 6
      	e_Unknown : 7
      }
      </pre>

#### getIconName()

  Returns the name of the icon associated with the Text annotation.

  ##### Returns:

  A promise that resolves to a string denoting the name of the icon.

  Type
    string

#### getState()

  Returns the string indicating the state of the Text annotation. (PDF 1.5)

  ##### Returns:

  A promise that resolves to a string that indicates the state of the Text annotation when first loaded.
  Default: "Unmarked" if StateModel is "Marked"; "None" if StateModel is "Review".

  Type
    string

#### getStateModel()

  Returns the string indicating the state model of the Text annotation. (PDF 1.5)

  ##### Returns:

  A promise that resolves to a string containing the state model name either "Marked" or "Review".

  Type
    string

#### isOpen()

  Returns the initial status of the Text annotation.

  ##### Returns:

  A promise that resolves to a boolean value that specifies whether the annotation shall initially be displayed as opened. Default value: false.

  Type
    boolean

#### setIcon(icon)

  sets the type of the icon associated with the Text annotation. (Optional)

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `icon` | number/enum |
      PDFNet.TextAnnot.Icon = {
      	e_Comment : 0
      	e_Key : 1
      	e_Help : 2
      	e_NewParagraph : 3
      	e_Paragraph : 4
      	e_Insert : 5
      	e_Note : 6
      	e_Unknown : 7
      }
  A value of the enum "Icon" type. Default value: e_Note.

#### setIconDefault()

#### setIconName(icon)

  sets the name of the icon associated with the Text annotation. (Optional)

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `icon` | string | A string denoting the name of the icon.

#### setOpen(isopen)

  sets the initial status of the Text annotation. (Optional)

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `isopen` | boolean | A boolean value that specifies whether the annotation shall initially be displayed as opened. Default value: false.

#### setState(state)

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

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `state` | string | A string that indicates the state of the Text annotation when first loaded. Default: "Unmarked" if StateModel is "Marked"; "None" if StateModel is "Review".

#### setStateModel(sm)

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

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `sm` | string | A string containing the state model name either "Marked" or "Review".

#### Search results