TextAnnotation Class
Defines a text annotation in a PDF document.
Declaration
public class TextAnnotation extends MarkupAnnotation
Remarks
The following code snippet creates a sticky note and adds it to the first page:

// Get the first page in the document.
Page page = pdfDocument.getPages().getFirst();
TextAnnotation annotation = new TextAnnotation(new RectangleF(50, 430, 24, 36));
annotation.setTitle("Brian Zetc");
annotation.setContent("Please review this paragraph.");
annotation.setColor(PdfColor.getLightGray());
page.getAnnotations().add(annotation);
Refer to the following help topic for additional information: Text Annotations — Sticky Notes.
Inherited Members
Inheritance
TextAnnotation(RectangleF bounds)
Initializes a new instance of the TextAnnotation class with specified settings.
Declaration
public TextAnnotation(RectangleF bounds)
Parameters
| Name | Type | Description |
|---|---|---|
| bounds | RectangleF | The annotation bounds. |
Methods
getIconName() Method
Returns the text annotation icon name.
Declaration
public TextAnnotationIconName getIconName()
Returns
| Type | Description |
|---|---|
| TextAnnotationIconName | The text annotation icon name. |
getIsOpened() Method
Returns whether the text annotation popup window is open.
Declaration
public boolean getIsOpened()
Returns
| Type | Description |
|---|---|
| boolean |
|
getState() Method
Returns the text annotation state.
Declaration
public String getState()
Returns
| Type | Description |
|---|---|
| String | The text annotation state. |
getStateModel() Method
Returns the text annotation state model.
Declaration
public String getStateModel()
Returns
| Type | Description |
|---|---|
| String | The text annotation state model. |
setIconName(TextAnnotationIconName value) Method
Sets the text annotation icon name.
Declaration
public void setIconName(TextAnnotationIconName value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | TextAnnotationIconName | The text annotation icon name. |
setIsOpened(boolean value) Method
Sets whether the text annotation popup window is open.
Declaration
public void setIsOpened(boolean value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | boolean |
|
setState(String value) Method
Sets the text annotation state.
Declaration
public void setState(String value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | String | The text annotation state. |
setStateModel(String value) Method
Sets the text annotation state model.
Declaration
public void setStateModel(String value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | String | The text annotation state model. |