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).
Extends
- MarkupAnnot
Members
-
<static> Icon
-
Properties:
Name Type Description e_Comment
number e_Key
number e_Help
number e_NewParagraph
number e_Paragraph
number e_Insert
number e_Note
number e_Unknown
number
Methods
-
<static> create(doc, pos)
-
Constructor
Parameters:
Name Type Description doc
PDFNet.PDFDoc | PDFNet.SDFDoc | PDFNet.FDFDoc pos
PDFNet.Rect Returns:
A promise that resolves to an object of type: "PDFNet.TextAnnot"- Type
- Promise.<PDFNet.TextAnnot>
-
<static> createAtPoint(doc, pos)
-
Parameters:
Name Type Description doc
PDFNet.PDFDoc | PDFNet.SDFDoc | PDFNet.FDFDoc pos
PDFNet.Point Returns:
A promise that resolves to an object of type: "PDFNet.TextAnnot"- Type
- Promise.<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: "PDFNet.TextAnnot"- Type
- Promise.<PDFNet.TextAnnot>
-
<static> createFromObj( [d])
-
creates a Text annotation and initializes it using given Cos/SDF object.
Parameters:
Name Type Argument Description d
PDFNet.Obj <optional>
The Cos/SDF object to initialze the annotation with. Returns:
A promise that resolves to an object of type: "PDFNet.TextAnnot"- Type
- Promise.<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
- Promise.<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
- Promise.<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
- Promise.<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
- Promise.<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
- Promise.<boolean>
-
setIcon( [icon])
-
sets the type of the icon associated with the Text annotation. (Optional)
Parameters:
Name Type Argument Description icon
number <optional>
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.Returns:
- Type
- Promise.<void>
-
setIconDefault()
-
Returns:
- Type
- Promise.<void>
-
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. Returns:
- Type
- Promise.<void>
-
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. Returns:
- Type
- Promise.<void>
-
setState( [state])
-
Sets the string indicating the state of the Text annotation. (Optional; PDF 1.5 )
Parameters:
Name Type Argument Description state
string <optional>
A string that indicates the state of the Text annotation when first loaded. Default: "Unmarked" if StateModel is "Marked"; "None" if StateModel is "Review". Returns:
- Type
- Promise.<void>
-
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". Returns:
- Type
- Promise.<void>