Skip to main content

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:

 Text Annotation (Sticky Note), DevExpress PDF Document API for Java

// 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

com.devexpress.system.JavaObject.clone()
com.devexpress.system.JavaObject.equals(java.lang.Object)
com.devexpress.system.JavaObject.hashCode()
com.devexpress.system.JavaObject.memberwiseClone()
com.devexpress.system.JavaObject.toString()
java.lang.Object.finalize()
java.lang.Object.getClass()
java.lang.Object.notify()
java.lang.Object.notifyAll()
java.lang.Object.wait()
java.lang.Object.wait(long)
java.lang.Object.wait(long,int)

Inheritance

Object
JavaObject

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

true if the text annotation popup window is open; otherwise, false.

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

true to open the text annotation popup window; otherwise, false.

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.