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/StampAnnotation#pubctors) \| [Methods](https://developer.android.com/reference/android/graphics/pdf/component/StampAnnotation#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/graphics/pdf/component/StampAnnotation#inhmethods)

# StampAnnotation

*** ** * ** ***


`
public

final

class
StampAnnotation
`


`


`

`

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.StampAnnotation |

<br />

*** ** * ** ***

Represents a stamp annotation in a PDF document.


Only path, image, or text objects created using the `https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject`,
`https://developer.android.com/reference/android/graphics/pdf/component/PdfPageImageObject`, or `https://developer.android.com/reference/android/graphics/pdf/component/PdfPageTextObject` constructors respectively
can be added to a stamp annotation.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/graphics/pdf/component/StampAnnotation#StampAnnotation(android.graphics.RectF)(https://developer.android.com/reference/android/graphics/RectF bounds) ` Creates a new stamp annotation with the specified bounds. |

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/graphics/pdf/component/StampAnnotation#addObject(android.graphics.pdf.component.PdfPageObject)(https://developer.android.com/reference/android/graphics/pdf/component/PdfPageObject pageObject) ` Adds a PDF page object to the stamp annotation. |
| ` https://developer.android.com/reference/android/graphics/RectF` | ` https://developer.android.com/reference/android/graphics/pdf/component/StampAnnotation#getBounds()() ` Returns the bounding rectangle of the stamp annotation. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/graphics/pdf/component/PdfPageObject>` | ` https://developer.android.com/reference/android/graphics/pdf/component/StampAnnotation#getObjects()() ` Returns all the known PDF page objects in the stamp annotation. |
| ` void` | ` https://developer.android.com/reference/android/graphics/pdf/component/StampAnnotation#removeObject(int)(int index) ` Remove the page object at the given index inside the stamp annotation. |
| ` void` | ` https://developer.android.com/reference/android/graphics/pdf/component/StampAnnotation#setBounds(android.graphics.RectF)(https://developer.android.com/reference/android/graphics/RectF bounds) ` Sets the bounding rectangle of the stamp 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

### StampAnnotation

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 StampAnnotation (RectF bounds)
```

Creates a new stamp annotation with the specified bounds.


The list of page objects inside the stamp annotation will be empty by default

<br />

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

## Public methods

### addObject

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 addObject (PdfPageObject pageObject)
```

Adds a PDF page object to the stamp annotation.


The page object should be a path, text or an image.

<br />

| Parameters ||
|---|---|
| `pageObject` | `PdfPageObject`: The PDF page object to add. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the page object is already added to a page or an annotation. |

### 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 stamp annotation.

<br />

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

### getObjects

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 List<PdfPageObject> getObjects ()
```

Returns all the known PDF page objects in the stamp annotation.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/graphics/pdf/component/PdfPageObject>` | The list of page objects in the annotation. This value cannot be `null`. <br /> |

### removeObject

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 removeObject (int index)
```

Remove the page object at the given index inside the stamp annotation. Here index is the
index of the page object in the list of page objects returned by `https://developer.android.com/reference/android/graphics/pdf/component/StampAnnotation#getObjects()`

<br />

| Parameters ||
|---|---|
| `index` | `int`: - index of the object to be removed. Value is 0 or greater <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if there is no object in the annotation with the given id |

### 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 stamp annotation.

<br />

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