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.
Implements
Inherited Members
Namespace: pdftron.PDF.Annots
Assembly: PDFNetAndroid.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. |
System.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 |
Finalize()
Releases all resources used by the Text
Declaration
protected void Finalize()
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 |
---|---|
System.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 |
---|---|
System.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 |
---|---|
System.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 |
---|---|
System.Boolean | 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(Text.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 |
SetIcon(String)
Sets the string indicating the type of icon corresponding to (Optional).
Declaration
public void SetIcon(string icon)
Parameters
Type | Name | Description |
---|---|---|
System.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 |
SetOpen(Boolean)
Sets the initial openning condition of the Text annotation. (Optional)
Declaration
public void SetOpen(bool isopen)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | 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 |
---|---|---|
System.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 |
---|---|---|
System.String | statemodule |
|
Remarks
The State model is the state model corresponding to the State entry;
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |