Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [S Extensions 13](https://developer.android.com/sdkExtensions)

# Page

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/graphics/pdf/PdfRendererPreV.Page "View this page in Java")

```
class Page : AutoCloseable
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.graphics.pdf.PdfRendererPreV.Page](https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#) |

This class represents a PDF document page for rendering.

## Summary

| Public methods ||
|---|---|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#addPageAnnotation(android.graphics.pdf.component.PdfAnnotation)(annotation: https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfAnnotation)` Adds the given annotation to the page. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#addPageObject(android.graphics.pdf.component.PdfPageObject)(pageObject: https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPageObject)` Adds the given `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPageObject` to the page. |
| [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[Rect](https://developer.android.com/reference/kotlin/android/graphics/Rect.html#)!\> | `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#applyEdit(android.graphics.pdf.models.FormEditRecord)(editRecord: https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormEditRecord)` Applies a `https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormEditRecord` to the PDF. |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#close()()` Closes this page. |
| [FormWidgetInfo](https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormWidgetInfo) | `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#getFormWidgetInfoAtIndex(kotlin.Int)(annotationIndex: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Returns information about the widget with `annotationIndex`. |
| [FormWidgetInfo](https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormWidgetInfo) | `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#getFormWidgetInfoAtPosition(kotlin.Int,%20kotlin.Int)(x: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html, y: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Returns information about the widget at the given point. |
| [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[FormWidgetInfo](https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormWidgetInfo)!\> | `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#getFormWidgetInfos()()` Returns information about all form widgets on the page, or an empty list if there are no form widgets on the page. |
| [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[FormWidgetInfo](https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormWidgetInfo)!\> | `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#getFormWidgetInfos(kotlin.IntArray)(types: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int-array/index.html)` Returns information about all form widgets of the specified types on the page, or an empty list if there are no form widgets of the specified types on the page. |
| [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[PdfPageGotoLinkContent](https://developer.android.com/reference/kotlin/android/graphics/pdf/content/PdfPageGotoLinkContent)!\> | `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#getGotoLinks()()` Gets bookmarks and goto links present on the page of a pdf document. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#getHeight()()` Returns the height of the given `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#` object in points (1/72"). |
| [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[PdfPageImageContent](https://developer.android.com/reference/kotlin/android/graphics/pdf/content/PdfPageImageContent)!\> | `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#getImageContents()()` Return list of `https://developer.android.com/reference/kotlin/android/graphics/pdf/content/PdfPageImageContent` found on the page, ordered left to right and top to bottom. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#getIndex()()` Gets the page index. |
| [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[PdfPageLinkContent](https://developer.android.com/reference/kotlin/android/graphics/pdf/content/PdfPageLinkContent)!\> | `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#getLinkContents()()` Get the bounds and URLs of all the links on the given page. |
| [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[Pair](https://developer.android.com/reference/kotlin/android/util/Pair.html#)\<[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)!, [PdfAnnotation](https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfAnnotation)!\>!\> | `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#getPageAnnotations()()` Returns a list of pairs, where each pair consists of a supported `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfAnnotation` and its corresponding ID on the specified page. |
| [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[Pair](https://developer.android.com/reference/kotlin/android/util/Pair.html#)\<[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)!, [PdfPageObject](https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPageObject)!\>!\> | `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#getPageObjects()()` Returns `https://developer.android.com/reference/kotlin/java/util/List.html#` of `https://developer.android.com/reference/kotlin/android/util/Pair.html#` objects, where each pair contains: - An `https://developer.android.com/reference/kotlin/java/lang/Integer.html#` representing the object ID, which is required for `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#updatePageObject(kotlin.Int,%20android.graphics.pdf.component.PdfPageObject)` and `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#removePageObject(kotlin.Int)`. |
| [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[PdfPageTextContent](https://developer.android.com/reference/kotlin/android/graphics/pdf/content/PdfPageTextContent)!\> | `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#getTextContents()()` Return list of `https://developer.android.com/reference/kotlin/android/graphics/pdf/content/PdfPageTextContent` found on the page, ordered left to right and top to bottom. |
| [Pair](https://developer.android.com/reference/kotlin/android/util/Pair.html#)\<[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)!, [PdfPageObject](https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPageObject)!\>? | `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#getTopPageObjectAtPosition(android.graphics.PointF,%20kotlin.IntArray)(point: https://developer.android.com/reference/kotlin/android/graphics/PointF.html#, types: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int-array/index.html)` Retrieves the top-most page object at a specified position. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#getWidth()()` Returns the width of the given `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#` object in points (1/72"). |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#removePageAnnotation(kotlin.Int)(annotationId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Removes the annotation with the specified id. |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#removePageObject(kotlin.Int)(objectId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Removes the `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPageObject` with the specified ID. |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#render(android.graphics.Bitmap,%20android.graphics.Rect,%20android.graphics.Matrix,%20android.graphics.pdf.RenderParams)(destination: https://developer.android.com/reference/kotlin/android/graphics/Bitmap.html#, destClip: https://developer.android.com/reference/kotlin/android/graphics/Rect.html#?, transform: https://developer.android.com/reference/kotlin/android/graphics/Matrix.html#?, params: https://developer.android.com/reference/kotlin/android/graphics/pdf/RenderParams)` Renders a page to a bitmap. |
| [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[PageMatchBounds](https://developer.android.com/reference/kotlin/android/graphics/pdf/models/PageMatchBounds)!\> | `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#searchText(kotlin.String)(query: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` Search for the given string on the page and returns the bounds of all the matches. |
| [PageSelection](https://developer.android.com/reference/kotlin/android/graphics/pdf/models/selection/PageSelection)? | `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#selectContent(android.graphics.pdf.models.selection.SelectionBoundary,%20android.graphics.pdf.models.selection.SelectionBoundary)(start: https://developer.android.com/reference/kotlin/android/graphics/pdf/models/selection/SelectionBoundary, stop: https://developer.android.com/reference/kotlin/android/graphics/pdf/models/selection/SelectionBoundary)` Return a `https://developer.android.com/reference/kotlin/android/graphics/pdf/models/selection/PageSelection` which represents the selected content that spans between the two boundaries. |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#updatePageAnnotation(kotlin.Int,%20android.graphics.pdf.component.PdfAnnotation)(annotationId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html, annotation: https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfAnnotation)` Update the given `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfAnnotation` to the page. |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#updatePageObject(kotlin.Int,%20android.graphics.pdf.component.PdfPageObject)(objectId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html, pageObject: https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPageObject)` Update the given `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPageObject` to the page. |

| Protected methods ||
|---|---|
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#finalize()()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. |

## Public methods

### addPageAnnotation

Added in [API level 36.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [S Extensions 18](https://developer.android.com/sdkExtensions)

```
fun addPageAnnotation(annotation: PdfAnnotation): Int
```

Adds the given annotation to the page. The annotation should be of supported type. See `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfAnnotationType` for the supported types

`https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV#write(android.os.ParcelFileDescriptor,%20kotlin.Boolean)` needs to be called to get the updated PDF stream after calling this method. `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#` instance can be closed before calling `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV#write(android.os.ParcelFileDescriptor,%20kotlin.Boolean)`.

| Parameters ||
|---|---|
| `annotation` | [PdfAnnotation](https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfAnnotation): the `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfAnnotation` object to add. This value cannot be `null`. |

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | id of the added annotation, or -1 if the annotation cannot be added. The id is guaranteed to be non-negative if the annotation is added successfully. Value is -1 or greater |

| Exceptions ||
|---|---|
| `java.lang.IllegalArgumentException` | if the provided annotation is of unsupported type i.e. `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfAnnotationType#UNKNOWN:kotlin.Int` or if the add operation failed. |
| `java.lang.IllegalStateException` | if `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV` or `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#` is closed before invocation |

### addPageObject

Added in [API level 36.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [S Extensions 18](https://developer.android.com/sdkExtensions)

```
fun addPageObject(pageObject: PdfPageObject): Int
```

Adds the given `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPageObject` to the page.

`https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRenderer#write(android.os.ParcelFileDescriptor,%20kotlin.Boolean)` needs to be called to get the updated PDF stream after calling this method. `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRenderer.Page` instance can be closed before calling `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRenderer#write(android.os.ParcelFileDescriptor,%20kotlin.Boolean)`.

| Parameters ||
|---|---|
| `pageObject` | [PdfPageObject](https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPageObject): the `PdfPageObject` object to add. This value cannot be `null`. |

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | id of the added page object, or -1 if the page object cannot be added. The id is guaranteed to be non-negative if the page object is added successfully. |

| Exceptions ||
|---|---|
| `java.lang.IllegalArgumentException` | if the provided `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPageObject` is of unsupported type i.e. `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPageObjectType#UNKNOWN:kotlin.Int` or if the add operation failed. |
| `java.lang.IllegalStateException` | if the `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRenderer.Page` is closed before invocation. |

### applyEdit

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [S Extensions 13](https://developer.android.com/sdkExtensions)

```
fun applyEdit(editRecord: FormEditRecord): MutableList<Rect!>
```

Applies a `https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormEditRecord` to the PDF.

Apps must call `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#render(android.graphics.Bitmap,%20android.graphics.Rect,%20android.graphics.Matrix,%20android.graphics.pdf.RenderParams)` to render new bitmaps for the corresponding areas of the page.

For click type `https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormEditRecord`s, performs a click on `https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormEditRecord#getClickPoint()`

For set text type `https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormEditRecord`s, sets the text value of the form widget.

For set indices type `https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormEditRecord`s, sets the `https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormEditRecord#getSelectedIndices()` as selected and all others as unselected for the form widget indicated by the record.

| Parameters ||
|---|---|
| `editRecord` | [FormEditRecord](https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormEditRecord): the `https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormEditRecord` to be applied. This value cannot be `null`. |

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html<https://developer.android.com/reference/kotlin/android/graphics/Rect.html#!>` | Rectangular areas of the page bitmap that have been invalidated by this action. This value cannot be `null`. |

| Exceptions ||
|---|---|
| `java.lang.IllegalArgumentException` | if the provided `https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormEditRecord` cannot be applied to the widget indicated by the index, or if the index does not correspond to a widget on the page. |
| `java.lang.IllegalStateException` | If the page is already closed. |

### close

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun close(): Unit
```

Closes this page.

| Exceptions ||
|---|---|
| `java.lang.Exception` | if this resource cannot be closed |

**See Also**

- `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRenderer#openPage(kotlin.Int)`

### getFormWidgetInfoAtIndex

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [S Extensions 13](https://developer.android.com/sdkExtensions)

```
fun getFormWidgetInfoAtIndex(annotationIndex: Int): FormWidgetInfo
```

Returns information about the widget with `annotationIndex`.

| Parameters ||
|---|---|
| `annotationIndex` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the index of the widget within the page's widget annotations array in the PDF document, available on results of previous calls to `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#getFormWidgetInfos(kotlin.IntArray)` or `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#getFormWidgetInfoAtPosition(kotlin.Int,%20kotlin.Int)` via `https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormWidgetInfo#getWidgetIndex()`. Value is 0 or greater |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormWidgetInfo` | This value cannot be `null`. |

| Exceptions ||
|---|---|
| `java.lang.IllegalArgumentException` | if there is no form widget at the provided index. |
| `java.lang.IllegalStateException` | If the page is already closed. |

### getFormWidgetInfoAtPosition

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [S Extensions 13](https://developer.android.com/sdkExtensions)

```
fun getFormWidgetInfoAtPosition(
    x: Int, 
    y: Int
): FormWidgetInfo
```

Returns information about the widget at the given point.

| Parameters ||
|---|---|
| `x` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the x position of the widget on the page, in points |
| `y` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the y position of the widget on the page, in points |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormWidgetInfo` | This value cannot be `null`. |

| Exceptions ||
|---|---|
| `java.lang.IllegalArgumentException` | if there is no form widget at the provided position. |
| `java.lang.IllegalStateException` | If the page is already closed. |

### getFormWidgetInfos

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [S Extensions 13](https://developer.android.com/sdkExtensions)

```
fun getFormWidgetInfos(): MutableList<FormWidgetInfo!>
```

Returns information about all form widgets on the page, or an empty list if there are no form widgets on the page.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html<https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormWidgetInfo!>` | This value cannot be `null`. |

| Exceptions ||
|---|---|
| `java.lang.IllegalStateException` | If the page is already closed. |

### getFormWidgetInfos

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [S Extensions 13](https://developer.android.com/sdkExtensions)

```
fun getFormWidgetInfos(types: IntArray): MutableList<FormWidgetInfo!>
```

Returns information about all form widgets of the specified types on the page, or an empty list if there are no form widgets of the specified types on the page.

| Parameters ||
|---|---|
| `types` | [IntArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int-array/index.html): the types of form widgets to return, or an empty array to return all widgets. This value cannot be `null`. Value is one of the following: - `https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormWidgetInfo#WIDGET_TYPE_UNKNOWN:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormWidgetInfo#WIDGET_TYPE_PUSHBUTTON:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormWidgetInfo#WIDGET_TYPE_CHECKBOX:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormWidgetInfo#WIDGET_TYPE_RADIOBUTTON:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormWidgetInfo#WIDGET_TYPE_COMBOBOX:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormWidgetInfo#WIDGET_TYPE_LISTBOX:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormWidgetInfo#WIDGET_TYPE_TEXTFIELD:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormWidgetInfo#WIDGET_TYPE_SIGNATURE:kotlin.Int` |

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html<https://developer.android.com/reference/kotlin/android/graphics/pdf/models/FormWidgetInfo!>` | This value cannot be `null`. |

| Exceptions ||
|---|---|
| `java.lang.IllegalStateException` | If the page is already closed. |

### getGotoLinks

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [S Extensions 13](https://developer.android.com/sdkExtensions)

```
fun getGotoLinks(): MutableList<PdfPageGotoLinkContent!>
```

Gets bookmarks and goto links present on the page of a pdf document. Goto Links are the internal navigation links which directs the user to different location within the same document.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html<https://developer.android.com/reference/kotlin/android/graphics/pdf/content/PdfPageGotoLinkContent!>` | list of all goto links `https://developer.android.com/reference/kotlin/android/graphics/pdf/content/PdfPageGotoLinkContent` on a page, ordered left to right and top to bottom. This value cannot be `null`. |

| Exceptions ||
|---|---|
| `java.lang.IllegalStateException` | If the document/page is closed before invocation. |

### getHeight

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [S Extensions 13](https://developer.android.com/sdkExtensions)

```
fun getHeight(): Int
```

Returns the height of the given `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#` object in points (1/72"). It is not guaranteed that all pages will have the same height and the viewport should be resized to the given page height.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | height of the given page. Value is 0 or greater |

| Exceptions ||
|---|---|
| `java.lang.IllegalStateException` | If the document/page is closed before invocation. |

### getImageContents

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [S Extensions 13](https://developer.android.com/sdkExtensions)

```
fun getImageContents(): MutableList<PdfPageImageContent!>
```

Return list of `https://developer.android.com/reference/kotlin/android/graphics/pdf/content/PdfPageImageContent` found on the page, ordered left to right and top to bottom. It contains all the content associated with images found on the page including alt text. The list will be empty if there are no results found. Currently, localisation does not have any impact on the order in which `https://developer.android.com/reference/kotlin/android/graphics/pdf/content/PdfPageImageContent` is returned.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html<https://developer.android.com/reference/kotlin/android/graphics/pdf/content/PdfPageImageContent!>` | list of image content found on the page. This value cannot be `null`. |

| Exceptions ||
|---|---|
| `java.lang.IllegalStateException` | If the document/page is closed before invocation. |

### getIndex

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [S Extensions 13](https://developer.android.com/sdkExtensions)

```
fun getIndex(): Int
```

Gets the page index.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | The index. Value is 0 or greater |

### getLinkContents

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [S Extensions 13](https://developer.android.com/sdkExtensions)

```
fun getLinkContents(): MutableList<PdfPageLinkContent!>
```

Get the bounds and URLs of all the links on the given page.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html<https://developer.android.com/reference/kotlin/android/graphics/pdf/content/PdfPageLinkContent!>` | list of all links on the page. This value cannot be `null`. |

| Exceptions ||
|---|---|
| `java.lang.IllegalStateException` | If the document/page is closed before invocation. |

### getPageAnnotations

Added in [API level 36.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [S Extensions 18](https://developer.android.com/sdkExtensions)

```
fun getPageAnnotations(): MutableList<Pair<Int!, PdfAnnotation!>!>
```

Returns a list of pairs, where each pair consists of a supported `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfAnnotation` and its corresponding ID on the specified page. ID of the annotation will be required for `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#updatePageAnnotation(kotlin.Int,%20android.graphics.pdf.component.PdfAnnotation)` and `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#removePageAnnotation(kotlin.Int)` and will remain same without mutate operations.

The returned list will be empty if no supported annotations are present on the page, even if the page contains other annotation types. Refer to `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfAnnotationType` for the supported annotation types.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html<https://developer.android.com/reference/kotlin/android/util/Pair.html#<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html!, https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfAnnotation!>!>` | A list of pairs representing the supported annotations and their ids on the page. This value cannot be `null`. |

| Exceptions ||
|---|---|
| `java.lang.IllegalStateException` | if `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV` or `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#` is closed before invocation. |

### getPageObjects

Added in [API level 36.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [S Extensions 18](https://developer.android.com/sdkExtensions)

```
fun getPageObjects(): MutableList<Pair<Int!, PdfPageObject!>!>
```

Returns `https://developer.android.com/reference/kotlin/java/util/List.html#` of `https://developer.android.com/reference/kotlin/android/util/Pair.html#` objects, where each pair contains: - An `https://developer.android.com/reference/kotlin/java/lang/Integer.html#` representing the object ID, which is required for `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#updatePageObject(kotlin.Int,%20android.graphics.pdf.component.PdfPageObject)` and `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#removePageObject(kotlin.Int)`. Object ID will remain same without mutate operations. - A `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPageObject` representing the page object.

The list will be empty if there are no supported page objects present on the page, even if the page contains other page object types.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html<https://developer.android.com/reference/kotlin/android/util/Pair.html#<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html!, https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPageObject!>!>` | `https://developer.android.com/reference/kotlin/java/util/List.html#` of `https://developer.android.com/reference/kotlin/android/util/Pair.html#` objects containing `https://developer.android.com/reference/kotlin/java/lang/Integer.html#` and `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPageObject`. This value cannot be `null`. |

| Exceptions ||
|---|---|
| `java.lang.IllegalStateException` | if the `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRenderer.Page` is closed before invocation. |

### getTextContents

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [S Extensions 13](https://developer.android.com/sdkExtensions)

```
fun getTextContents(): MutableList<PdfPageTextContent!>
```

Return list of `https://developer.android.com/reference/kotlin/android/graphics/pdf/content/PdfPageTextContent` found on the page, ordered left to right and top to bottom. It contains all the content associated with text found on the page. The list will be empty if there are no results found. Currently, localisation does not have any impact on the order in which `https://developer.android.com/reference/kotlin/android/graphics/pdf/content/PdfPageTextContent` is returned.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html<https://developer.android.com/reference/kotlin/android/graphics/pdf/content/PdfPageTextContent!>` | list of text content found on the page. This value cannot be `null`. |

| Exceptions ||
|---|---|
| `java.lang.IllegalStateException` | If the document/page is closed before invocation. |

### getTopPageObjectAtPosition

Added in [API level 36.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [S Extensions 19](https://developer.android.com/sdkExtensions)

```
fun getTopPageObjectAtPosition(
    point: PointF, 
    types: IntArray
): Pair<Int!, PdfPageObject!>?
```

Retrieves the top-most page object at a specified position.

| Parameters ||
|---|---|
| `point` | [PointF](https://developer.android.com/reference/kotlin/android/graphics/PointF.html#): The coordinates (as a `https://developer.android.com/reference/kotlin/android/graphics/PointF.html#`) on the page to check for page objects. This value cannot be `null`. |
| `types` | [IntArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int-array/index.html): An array of android.graphics.pdf.component.PdfPageObjectType.Type values. Only page objects whose types are included in this array will be considered. If multiple matching objects overlap at the specified point, only the one with the highest z-index will be returned. The order of types within this array does not influence the outcome. If this array is empty, known supported `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPageObjectType`s will be considered. This value cannot be `null`. Value is one of the following: - `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPageObjectType#UNKNOWN:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPageObjectType#TEXT:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPageObjectType#PATH:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPageObjectType#IMAGE:kotlin.Int` |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/util/Pair.html#<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html!, https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPageObject!>?` | A `https://developer.android.com/reference/kotlin/android/util/Pair.html#` containing: - An `https://developer.android.com/reference/kotlin/java/lang/Integer.html#` representing the unique ID of the page object. - A `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPageObject` representing the found page object. Returns null if no page object is found at the given position. |

| Exceptions ||
|---|---|
| `java.lang.IllegalArgumentException` | if the provided type(s) are not supported. |
| `java.lang.IllegalStateException` | if the `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRenderer.Page` is closed before invocation. |

### getWidth

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [S Extensions 13](https://developer.android.com/sdkExtensions)

```
fun getWidth(): Int
```

Returns the width of the given `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#` object in points (1/72"). It is not guaranteed that all pages will have the same width and the viewport should be resized to the given page width.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | width of the given page. Value is 0 or greater |

| Exceptions ||
|---|---|
| `java.lang.IllegalStateException` | If the document/page is closed before invocation. |

### removePageAnnotation

Added in [API level 36.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [S Extensions 18](https://developer.android.com/sdkExtensions)

```
fun removePageAnnotation(annotationId: Int): Unit
```

Removes the annotation with the specified id.

`https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV#write(android.os.ParcelFileDescriptor,%20kotlin.Boolean)` needs to be called to get the updated PDF stream after calling this method. `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#` instance can be closed before calling `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV#write(android.os.ParcelFileDescriptor,%20kotlin.Boolean)`.

| Parameters ||
|---|---|
| `annotationId` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): id of the annotation to remove from the page. Value is 0 or greater |

| Exceptions ||
|---|---|
| `java.lang.IllegalArgumentException` | if annotationId is negative or invalid or if the remove operation failed. |
| `java.lang.IllegalStateException` | if `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV` or `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#` is closed before invocation or if annotation is failed to get removed from the page. |

### removePageObject

Added in [API level 36.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [S Extensions 18](https://developer.android.com/sdkExtensions)

```
fun removePageObject(objectId: Int): Unit
```

Removes the `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPageObject` with the specified ID.

`https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRenderer#write(android.os.ParcelFileDescriptor,%20kotlin.Boolean)` needs to be called to get the updated PDF stream after calling this method. `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRenderer.Page` instance can be closed before calling `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRenderer#write(android.os.ParcelFileDescriptor,%20kotlin.Boolean)`.

| Parameters ||
|---|---|
| `objectId` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the id of the page object to remove from the page. Value is 0 or greater |

| Exceptions ||
|---|---|
| `java.lang.IllegalArgumentException` | if the provided objectId is negative or invalid or if the remove operation failed. |
| `java.lang.IllegalStateException` | if the page object cannot be removed. |

### render

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [S Extensions 13](https://developer.android.com/sdkExtensions)

```
fun render(
    destination: Bitmap, 
    destClip: Rect?, 
    transform: Matrix?, 
    params: RenderParams
): Unit
```

Renders a page to a bitmap. In case of default zoom, the `https://developer.android.com/reference/kotlin/android/graphics/Bitmap.html#` dimensions will be equal to the page dimensions. In this case, `https://developer.android.com/reference/kotlin/android/graphics/Rect.html#` parameter can be null.

In case of zoom, the `https://developer.android.com/reference/kotlin/android/graphics/Rect.html#` parameter needs to be specified which represents the offset from top and left for tile generation purposes. In this case, the `https://developer.android.com/reference/kotlin/android/graphics/Bitmap.html#` dimensions should be equal to the tile dimensions.

**Note:** The method will take care of closing the bitmap. Should be invoked on the `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#` as it is long-running task.

| Parameters ||
|---|---|
| `destination` | [Bitmap](https://developer.android.com/reference/kotlin/android/graphics/Bitmap.html#): Destination bitmap to write to. This value cannot be `null`. |
| `destClip` | [Rect](https://developer.android.com/reference/kotlin/android/graphics/Rect.html#)?: If null, default zoom is applied. In case the value is non-null, the value specifies the top top-left corner of the tile. |
| `transform` | [Matrix](https://developer.android.com/reference/kotlin/android/graphics/Matrix.html#)?: Applied to scale the bitmap up/down from default 1/72 points. This value may be `null`. |
| `params` | [RenderParams](https://developer.android.com/reference/kotlin/android/graphics/pdf/RenderParams): Render params for the changing display mode, and / or to control the appearance of annotations and PDF form content. This value cannot be `null`. |

| Exceptions ||
|---|---|
| `java.lang.IllegalStateException` | If the document/page is closed before invocation. |

### searchText

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [S Extensions 13](https://developer.android.com/sdkExtensions)

```
fun searchText(query: String): MutableList<PageMatchBounds!>
```

Search for the given string on the page and returns the bounds of all the matches. The list will be empty if there are no matches on the given page. If this function was invoked previously for any page, it will wait for that operation to complete before this operation is started.

**Note:** Should be invoked on the `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#` as it is long-running task.

| Parameters ||
|---|---|
| `query` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): plain search string for querying the document. This value cannot be `null`. |

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html<https://developer.android.com/reference/kotlin/android/graphics/pdf/models/PageMatchBounds!>` | List of `https://developer.android.com/reference/kotlin/android/graphics/pdf/models/PageMatchBounds` representing the bounds of each match on the page. This value cannot be `null`. |

| Exceptions ||
|---|---|
| `java.lang.IllegalStateException` | If the document/page is closed before invocation. |

### selectContent

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [S Extensions 13](https://developer.android.com/sdkExtensions)

```
fun selectContent(
    start: SelectionBoundary, 
    stop: SelectionBoundary
): PageSelection?
```

Return a `https://developer.android.com/reference/kotlin/android/graphics/pdf/models/selection/PageSelection` which represents the selected content that spans between the two boundaries. The boundaries can be either exactly defined with text indexes, or approximately defined with points on the page. The resulting selection will also be exactly defined with both indexes and points. If the start and stop boundary are both at the same point, selects the word at that point. In case the selection from the given boundaries result in an empty space, then the method returns `null`. The start and stop `https://developer.android.com/reference/kotlin/android/graphics/pdf/models/selection/SelectionBoundary` in `https://developer.android.com/reference/kotlin/android/graphics/pdf/models/selection/PageSelection` resolves to the "nearest" index when returned.

**Note:** Should be invoked on a `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#` as it is long-running task.

| Parameters ||
|---|---|
| `start` | [SelectionBoundary](https://developer.android.com/reference/kotlin/android/graphics/pdf/models/selection/SelectionBoundary): boundary where the selection starts (inclusive). This value cannot be `null`. |
| `stop` | [SelectionBoundary](https://developer.android.com/reference/kotlin/android/graphics/pdf/models/selection/SelectionBoundary): boundary where the selection stops (exclusive). This value cannot be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/graphics/pdf/models/selection/PageSelection?` | collection of the selected content for text, images, etc. |

| Exceptions ||
|---|---|
| `java.lang.IllegalStateException` | If the document/page is closed before invocation. |

### updatePageAnnotation

Added in [API level 36.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [S Extensions 18](https://developer.android.com/sdkExtensions)

```
fun updatePageAnnotation(
    annotationId: Int, 
    annotation: PdfAnnotation
): Boolean
```

Update the given `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfAnnotation` to the page.

Note: The `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfAnnotationType` of the provided annotation must be the same as the original annotation being updated.

`https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV#write(android.os.ParcelFileDescriptor,%20kotlin.Boolean)` needs to be called to get the updated PDF stream after calling this method. `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#` instance can be closed before calling `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV#write(android.os.ParcelFileDescriptor,%20kotlin.Boolean)`.

| Parameters ||
|---|---|
| `annotationId` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): id corresponding to which the annotation is to be updated. Value is 0 or greater |
| `annotation` | [PdfAnnotation](https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfAnnotation): the annotation to update. This value cannot be `null`. |

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | true if annotation is updated, false otherwise |

| Exceptions ||
|---|---|
| `java.lang.IllegalArgumentException` | if the provided annotation is of unsupported type i.e. `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfAnnotationType#UNKNOWN:kotlin.Int` or if the provided annotationId is negative or if `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfAnnotationType` of the provided annotation is different from the original annotation's type |
| `java.lang.IllegalStateException` | if `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV` or `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRendererPreV.Page#` is closed before invocation |

### updatePageObject

Added in [API level 36.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [S Extensions 18](https://developer.android.com/sdkExtensions)

```
fun updatePageObject(
    objectId: Int, 
    pageObject: PdfPageObject
): Boolean
```

Update the given `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPageObject` to the page.

Note: This method only updates the parameters of the PageObject whose setters are available. Attempting to update fields with no corresponding setters will have no effect. Furthermore, the `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPageObjectType` of the provided pageObject must be the same as the original pageObject being updated.

`https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRenderer#write(android.os.ParcelFileDescriptor,%20kotlin.Boolean)` needs to be called to get the updated PDF stream after calling this method. `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRenderer.Page` instance can be closed before calling `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRenderer#write(android.os.ParcelFileDescriptor,%20kotlin.Boolean)`.

| Parameters ||
|---|---|
| `objectId` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The unique identifier of the page object to update. Value is 0 or greater |
| `pageObject` | [PdfPageObject](https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPageObject): The `PdfPageObject` object to update. This value cannot be `null`. |

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | true if page object is updated, false otherwise. |

| Exceptions ||
|---|---|
| `java.lang.IllegalArgumentException` | if the provided `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPageObject` is unsupported or if the `https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPageObjectType` of the provided pageObject is different from the original pageObject's type. |
| `java.lang.IllegalStateException` | if the `https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfRenderer.Page` is closed before invocation. |

## Protected methods

### finalize

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
protected fun finalize(): Unit
```

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. A subclass overrides the `finalize` method to dispose of system resources or to perform other cleanup.

The general contract of `finalize` is that it is invoked if and when the Java virtual machine has determined that there is no longer any means by which this object can be accessed by any thread that has not yet died, except as a result of an action taken by the finalization of some other object or class which is ready to be finalized. The `finalize` method may take any action, including making this object available again to other threads; the usual purpose of `finalize`, however, is to perform cleanup actions before the object is irrevocably discarded. For example, the finalize method for an object that represents an input/output connection might perform explicit I/O transactions to break the connection before the object is permanently discarded.

The `finalize` method of class `Object` performs no special action; it simply returns normally. Subclasses of `Object` may override this definition.

The Java programming language does not guarantee which thread will invoke the `finalize` method for any given object. It is guaranteed, however, that the thread that invokes finalize will not be holding any user-visible synchronization locks when finalize is invoked. If an uncaught exception is thrown by the finalize method, the exception is ignored and finalization of that object terminates.

After the `finalize` method has been invoked for an object, no further action is taken until the Java virtual machine has again determined that there is no longer any means by which this object can be accessed by any thread that has not yet died, including possible actions by other objects or classes which are ready to be finalized, at which point the object may be discarded.

The `finalize` method is never invoked more than once by a Java virtual machine for any given object.

Any exception thrown by the `finalize` method causes the finalization of this object to be halted, but is otherwise ignored.

| Exceptions ||
|---|---|
| `java.lang.Throwable` | the `Exception` raised by this method |