Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 18](https://developer.android.com/sdkExtensions) Summary: [Ctors](https://developer.android.com/reference/android/graphics/pdf/component/FreeTextAnnotation#pubctors) \| [Methods](https://developer.android.com/reference/android/graphics/pdf/component/FreeTextAnnotation#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/graphics/pdf/component/FreeTextAnnotation#inhmethods)

# FreeTextAnnotation

*** ** * ** ***


`
public

final

class
FreeTextAnnotation
`


`


`

`

extends https://developer.android.com/reference/android/graphics/pdf/component/PdfAnnotation


`

`


`

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||
| ↳ | [android.graphics.pdf.component.PdfAnnotation](https://developer.android.com/reference/android/graphics/pdf/component/PdfAnnotation) ||
|   | ↳ | android.graphics.pdf.component.FreeTextAnnotation |

<br />

*** ** * ** ***

Represents a free text annotation in a PDF document.


This class allows creating and manipulating free text
annotations. A free text annotation in a PDF is a type of
annotation that allows you to add text directly onto the page.


If text color is not set using
`https://developer.android.com/reference/android/graphics/pdf/component/FreeTextAnnotation#setTextColor(int)`, the default text color is
black and if the background color is not set using
`https://developer.android.com/reference/android/graphics/pdf/component/FreeTextAnnotation#setBackgroundColor(int)`, the default background color is
white.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/graphics/pdf/component/FreeTextAnnotation#FreeTextAnnotation(android.graphics.RectF,%20java.lang.String)(https://developer.android.com/reference/android/graphics/RectF bounds, https://developer.android.com/reference/java/lang/String textContent) ` Creates a new free text annotation with the specified bounds and text content. |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/graphics/pdf/component/FreeTextAnnotation#getBackgroundColor()() ` Returns the background color of the freetext annotation. |
| ` https://developer.android.com/reference/android/graphics/RectF` | ` https://developer.android.com/reference/android/graphics/pdf/component/FreeTextAnnotation#getBounds()() ` Returns the bounding rectangle of the freetext annotation. |
| ` int` | ` https://developer.android.com/reference/android/graphics/pdf/component/FreeTextAnnotation#getTextColor()() ` Returns the text color of the freetext annotation. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/graphics/pdf/component/FreeTextAnnotation#getTextContent()() ` Returns the text content of the freetext annotation. |
| ` void` | ` https://developer.android.com/reference/android/graphics/pdf/component/FreeTextAnnotation#setBackgroundColor(int)(int color) ` Sets the background color of the freetext annotation. |
| ` void` | ` https://developer.android.com/reference/android/graphics/pdf/component/FreeTextAnnotation#setBounds(android.graphics.RectF)(https://developer.android.com/reference/android/graphics/RectF bounds) ` Sets the bounding rectangle of the freetext annotation. |
| ` void` | ` https://developer.android.com/reference/android/graphics/pdf/component/FreeTextAnnotation#setTextColor(int)(int color) ` Sets the text color of the annotation. |
| ` void` | ` https://developer.android.com/reference/android/graphics/pdf/component/FreeTextAnnotation#setTextContent(java.lang.String)(https://developer.android.com/reference/java/lang/String text) ` Sets the text content of the annotation. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/android/graphics/pdf/component/PdfAnnotation ` |---|---| | ` int` | ` https://developer.android.com/reference/android/graphics/pdf/component/PdfAnnotation#getPdfAnnotationType()() ` Returns the type of the annotation. | ||
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Public constructors

### FreeTextAnnotation

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 18](https://developer.android.com/sdkExtensions)

```
public FreeTextAnnotation (RectF bounds, 
                String textContent)
```

Creates a new free text annotation with the specified bounds and text content.


The default text color and background color will be black and white respectively.
Also, transparency of the text color can't be modified i.e. alpha value of the text color
will always be 1

<br />

| Parameters ||
|---|---|
| `bounds` | `RectF`: The bounding rectangle of the annotation. This value cannot be `null`. <br /> |
| `textContent` | `String`: The text content of the annotation. This value cannot be `null`. <br /> |

## Public methods

### getBackgroundColor

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 18](https://developer.android.com/sdkExtensions)

```
public int getBackgroundColor ()
```

Returns the background color of the freetext annotation.

<br />

| Returns ||
|---|---|
| `int` | The background color. <br /> |

### getBounds

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 18](https://developer.android.com/sdkExtensions)

```
public RectF getBounds ()
```

Returns the bounding rectangle of the freetext annotation.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/RectF` | The bounding rectangle. This value cannot be `null`. <br /> |

### getTextColor

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 18](https://developer.android.com/sdkExtensions)

```
public int getTextColor ()
```

Returns the text color of the freetext annotation.

<br />

| Returns ||
|---|---|
| `int` | The text color. <br /> |

### getTextContent

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 18](https://developer.android.com/sdkExtensions)

```
public String getTextContent ()
```

Returns the text content of the freetext annotation.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | The text content. This value cannot be `null`. <br /> |

### setBackgroundColor

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 18](https://developer.android.com/sdkExtensions)

```
public void setBackgroundColor (int color)
```

Sets the background color of the freetext annotation.

<br />

| Parameters ||
|---|---|
| `color` | `int`: The new background color. <br /> |

### setBounds

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 18](https://developer.android.com/sdkExtensions)

```
public void setBounds (RectF bounds)
```

Sets the bounding rectangle of the freetext annotation.

<br />

| Parameters ||
|---|---|
| `bounds` | `RectF`: The new bounding rectangle. This value cannot be `null`. <br /> |

### setTextColor

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 18](https://developer.android.com/sdkExtensions)

```
public void setTextColor (int color)
```

Sets the text color of the annotation.


Please note that the transparency of the color can't be modified. Alpha value of the text
color will always be 1 (i.e. fully opaque) even if a color with different alpha value is
set using this method

<br />

| Parameters ||
|---|---|
| `color` | `int`: The new text color. <br /> |

### setTextContent

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 18](https://developer.android.com/sdkExtensions)

```
public void setTextContent (String text)
```

Sets the text content of the annotation.

<br />

| Parameters ||
|---|---|
| `text` | `String`: The new text content. This value cannot be `null`. <br /> |