# PdfDocument

Artifact: [androidx.pdf:pdf-core](https://developer.android.com/jetpack/androidx/releases/pdf) [View Source](https://cs.android.com/search?q=file:androidx/pdf/PdfDocument.kt+class:androidx.pdf.PdfDocument) Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

*** ** * ** ***


```
interface PdfDocument : Closeable
```

<br />

Known direct subclasses [EditablePdfDocument](https://developer.android.com/reference/kotlin/androidx/pdf/EditablePdfDocument)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/pdf/EditablePdfDocument` | Represents a PDF document that allows for editing. |

*** ** * ** ***

Represents a PDF document and provides methods to interact with its content.

## Summary

| ### Nested types |
|---|
| `interface https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.BitmapSource : https://developer.android.com/reference/java/io/Closeable.html` A source for retrieving bitmap representations of PDF pages. |
| `@https://developer.android.com/reference/kotlin/androidx/pdf/ExperimentalPdfApi interface https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.OnEditAppliedListener` Interface definition for a callback that notifies when an edit is applied using the `https://developer.android.com/reference/kotlin/androidx/pdf/EditablePdfDocument#applyEdits(androidx.pdf.EditsDraft)` method. |
| `interface https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.OnPdfContentInvalidatedListener` Listener interface for receiving notifications when some regions of the PDF content are invalidated. |
| `class https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.PageInfo` Represents information about a single page in the PDF document. |
| `class https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.PdfPageContent` Represents the combined text and image content within a single page of a PDF document. |
| `class https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.PdfPageLinks` Represents the links within a single page of a PDF document. |

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#FORM_WIDGET_INCLUDE_ALL_TYPES()` Flag to include all types of form widgets in `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getFormWidgetInfos(kotlin.Int,kotlin.Long)` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#FORM_WIDGET_INCLUDE_CHECKBOX_TYPE()` Flag to include `https://developer.android.com/reference/kotlin/androidx/pdf/models/FormWidgetInfo#WIDGET_TYPE_CHECKBOX()` in `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getFormWidgetInfos(kotlin.Int,kotlin.Long)` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#FORM_WIDGET_INCLUDE_COMBOBOX_TYPE()` Flag to include `https://developer.android.com/reference/kotlin/androidx/pdf/models/FormWidgetInfo#WIDGET_TYPE_COMBOBOX()` in `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getFormWidgetInfos(kotlin.Int,kotlin.Long)` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#FORM_WIDGET_INCLUDE_LISTBOX_TYPE()` Flag to include `https://developer.android.com/reference/kotlin/androidx/pdf/models/FormWidgetInfo#WIDGET_TYPE_LISTBOX()` in `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getFormWidgetInfos(kotlin.Int,kotlin.Long)` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#FORM_WIDGET_INCLUDE_PUSHBUTTON_TYPE()` Flag to include `https://developer.android.com/reference/kotlin/androidx/pdf/models/FormWidgetInfo#WIDGET_TYPE_PUSHBUTTON()` in `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getFormWidgetInfos(kotlin.Int,kotlin.Long)` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#FORM_WIDGET_INCLUDE_RADIOBUTTON_TYPE()` Flag to include `https://developer.android.com/reference/kotlin/androidx/pdf/models/FormWidgetInfo#WIDGET_TYPE_RADIOBUTTON()` in `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getFormWidgetInfos(kotlin.Int,kotlin.Long)` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#FORM_WIDGET_INCLUDE_SIGNATURE_TYPE()` Flag to include `https://developer.android.com/reference/kotlin/androidx/pdf/models/FormWidgetInfo#WIDGET_TYPE_SIGNATURE()` in `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getFormWidgetInfos(kotlin.Int,kotlin.Long)` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#FORM_WIDGET_INCLUDE_TEXTFIELD_TYPE()` Flag to include `https://developer.android.com/reference/kotlin/androidx/pdf/models/FormWidgetInfo#WIDGET_TYPE_TEXTFIELD()` in `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getFormWidgetInfos(kotlin.Int,kotlin.Long)` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#FORM_WIDGET_INCLUDE_UNKNOWN_TYPE()` Flag to include `https://developer.android.com/reference/kotlin/androidx/pdf/models/FormWidgetInfo#WIDGET_TYPE_UNKNOWN()` in `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getFormWidgetInfos(kotlin.Int,kotlin.Long)` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#LINEARIZATION_STATUS_LINEARIZED() = 1` Indicates that the document is linearized (optimized for fast web viewing) |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#LINEARIZATION_STATUS_NOT_LINEARIZED() = 0` Indicates that the document is not linearized |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#LINEARIZATION_STATUS_UNKNOWN() = 2` Indicates that the linearization status of the document could not be determined |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#PAGE_INFO_EXCLUDE_FORM_WIDGETS() = 0` Flag used with `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getPageInfo(kotlin.Int)` to exclude any additional information in the returned `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.PageInfo` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#PAGE_INFO_INCLUDE_FORM_WIDGET()` Flag used with `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getPageInfo(kotlin.Int)` to include form widget metadata in the `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.PageInfo` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#PDF_FORM_TYPE_ACRO_FORM() = 1` Represents a PDF with form fields specified using the AcroForm spec |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#PDF_FORM_TYPE_NONE() = 0` Represents a PDF with no form fields |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#PDF_FORM_TYPE_XFA_FOREGROUND() = 3` Represents a PDF with form fields specified using the XFAF subset of the XFA spec |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#PDF_FORM_TYPE_XFA_FULL() = 2` Represents a PDF with form fields specified using the entire XFA spec |

| ### Public functions |
|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/pdf/ExperimentalPdfApi https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#addOnEditAppliedListener(java.util.concurrent.Executor,androidx.pdf.PdfDocument.OnEditAppliedListener)( executor: https://developer.android.com/reference/java/util/concurrent/Executor.html, listener: https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.OnEditAppliedListener )` Adds a listener to be notified when an edit is applied on the document. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#addOnPdfContentInvalidatedListener(java.util.concurrent.Executor,androidx.pdf.PdfDocument.OnPdfContentInvalidatedListener)( executor: https://developer.android.com/reference/java/util/concurrent/Executor.html, listener: https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.OnPdfContentInvalidatedListener )` Adds a listener to receive notifications when some regions of the PDF content are invalidated. |
| `suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/pdf/annotation/content/KeyedPdfAnnotation>` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getAnnotationsForPage(kotlin.Int)(pageNum: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Retrieves a list of all annotations for the specified page. |
| `suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/pdf/models/FormWidgetInfo>` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getFormWidgetInfos(kotlin.Int,kotlin.Long)(pageNum: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, types: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Returns the list of `https://developer.android.com/reference/kotlin/androidx/pdf/models/FormWidgetInfo` on `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getFormWidgetInfos(kotlin.Int,kotlin.Long)`, optionally filtered by widget type. |
| `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.BitmapSource` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getPageBitmapSource(kotlin.Int)(pageNumber: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Gets a `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.BitmapSource` for retrieving bitmap representations of the specified page. |
| `suspend https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.PdfPageContent?` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getPageContent(kotlin.Int)(pageNumber: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Asynchronously retrieves the content (text and images) of the specified page. |
| `suspend https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.PageInfo` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getPageInfo(kotlin.Int)(pageNumber: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Asynchronously retrieves information about the specified page. |
| `suspend https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.PageInfo` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getPageInfo(kotlin.Int,kotlin.Long)(pageNumber: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, pageInfoFlags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Asynchronously retrieves information about the specified page. |
| `suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.PageInfo>` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getPageInfos(kotlin.ranges.IntRange)(pageRange: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.ranges/-int-range/index.html)` Asynchronously retrieves information about a range of pages. |
| `suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.PageInfo>` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getPageInfos(kotlin.ranges.IntRange,kotlin.Long)(pageRange: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.ranges/-int-range/index.html, pageInfoFlags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Asynchronously retrieves information about a range of pages. |
| `suspend https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.PdfPageLinks` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getPageLinks(kotlin.Int)(pageNumber: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Asynchronously retrieves the links (Go To and external) present on the specified page. |
| `suspend https://developer.android.com/reference/kotlin/androidx/pdf/content/PageSelection?` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getSelectionBounds(kotlin.Int,android.graphics.PointF,android.graphics.PointF)(pageNumber: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, start: https://developer.android.com/reference/android/graphics/PointF.html, stop: https://developer.android.com/reference/android/graphics/PointF.html)` Asynchronously retrieves the selection bounds (in PDF coordinates) for the specified text selection. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/pdf/ExperimentalPdfApi https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#removeOnEditAppliedListener(androidx.pdf.PdfDocument.OnEditAppliedListener)( listener: https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.OnEditAppliedListener )` Remove a listener for applied edits. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#removeOnPdfContentInvalidatedListener(androidx.pdf.PdfDocument.OnPdfContentInvalidatedListener)( listener: https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.OnPdfContentInvalidatedListener )` Removes the listener from the list of listeners which are notified when some regions of the PDF content are invalidated. |
| `suspend https://developer.android.com/reference/android/util/SparseArray.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/pdf/content/PageMatchBounds>>` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#searchDocument(kotlin.String,kotlin.ranges.IntRange)(query: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, pageRange: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.ranges/-int-range/index.html)` Asynchronously searches the document for the specified query within a range of pages. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#formType()` The type of form present in the document. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#linearizationStatus()` Indicates the linearization status of the document. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#pageCount()` The total number of pages in the document. |
| `https://developer.android.com/reference/kotlin/androidx/pdf/RenderParams` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#renderParams()` The render params used to determine the contents that will be rendered on the bitmap. |
| `https://developer.android.com/reference/android/net/Uri.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#uri()` The URI of the document represented by this object |

### Inherited functions

From [java.io.Closeable](https://developer.android.com/reference/java/io/Closeable.html) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/java/io/Closeable.html#close()()`

## Constants

### FORM_WIDGET_INCLUDE_ALL_TYPES

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
const val FORM_WIDGET_INCLUDE_ALL_TYPES: Long
```

Flag to include all types of form widgets in `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getFormWidgetInfos(kotlin.Int,kotlin.Long)`

### FORM_WIDGET_INCLUDE_CHECKBOX_TYPE

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
const val FORM_WIDGET_INCLUDE_CHECKBOX_TYPE: Long
```

Flag to include `https://developer.android.com/reference/kotlin/androidx/pdf/models/FormWidgetInfo#WIDGET_TYPE_CHECKBOX()` in `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getFormWidgetInfos(kotlin.Int,kotlin.Long)`

### FORM_WIDGET_INCLUDE_COMBOBOX_TYPE

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
const val FORM_WIDGET_INCLUDE_COMBOBOX_TYPE: Long
```

Flag to include `https://developer.android.com/reference/kotlin/androidx/pdf/models/FormWidgetInfo#WIDGET_TYPE_COMBOBOX()` in `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getFormWidgetInfos(kotlin.Int,kotlin.Long)`

### FORM_WIDGET_INCLUDE_LISTBOX_TYPE

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
const val FORM_WIDGET_INCLUDE_LISTBOX_TYPE: Long
```

Flag to include `https://developer.android.com/reference/kotlin/androidx/pdf/models/FormWidgetInfo#WIDGET_TYPE_LISTBOX()` in `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getFormWidgetInfos(kotlin.Int,kotlin.Long)`

### FORM_WIDGET_INCLUDE_PUSHBUTTON_TYPE

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
const val FORM_WIDGET_INCLUDE_PUSHBUTTON_TYPE: Long
```

Flag to include `https://developer.android.com/reference/kotlin/androidx/pdf/models/FormWidgetInfo#WIDGET_TYPE_PUSHBUTTON()` in `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getFormWidgetInfos(kotlin.Int,kotlin.Long)`

### FORM_WIDGET_INCLUDE_RADIOBUTTON_TYPE

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
const val FORM_WIDGET_INCLUDE_RADIOBUTTON_TYPE: Long
```

Flag to include `https://developer.android.com/reference/kotlin/androidx/pdf/models/FormWidgetInfo#WIDGET_TYPE_RADIOBUTTON()` in `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getFormWidgetInfos(kotlin.Int,kotlin.Long)`

### FORM_WIDGET_INCLUDE_SIGNATURE_TYPE

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
const val FORM_WIDGET_INCLUDE_SIGNATURE_TYPE: Long
```

Flag to include `https://developer.android.com/reference/kotlin/androidx/pdf/models/FormWidgetInfo#WIDGET_TYPE_SIGNATURE()` in `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getFormWidgetInfos(kotlin.Int,kotlin.Long)`

### FORM_WIDGET_INCLUDE_TEXTFIELD_TYPE

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
const val FORM_WIDGET_INCLUDE_TEXTFIELD_TYPE: Long
```

Flag to include `https://developer.android.com/reference/kotlin/androidx/pdf/models/FormWidgetInfo#WIDGET_TYPE_TEXTFIELD()` in `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getFormWidgetInfos(kotlin.Int,kotlin.Long)`

### FORM_WIDGET_INCLUDE_UNKNOWN_TYPE

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
const val FORM_WIDGET_INCLUDE_UNKNOWN_TYPE: Long
```

Flag to include `https://developer.android.com/reference/kotlin/androidx/pdf/models/FormWidgetInfo#WIDGET_TYPE_UNKNOWN()` in `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getFormWidgetInfos(kotlin.Int,kotlin.Long)`

### LINEARIZATION_STATUS_LINEARIZED

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
const val LINEARIZATION_STATUS_LINEARIZED = 1: Int
```

Indicates that the document is linearized (optimized for fast web viewing)

### LINEARIZATION_STATUS_NOT_LINEARIZED

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
const val LINEARIZATION_STATUS_NOT_LINEARIZED = 0: Int
```

Indicates that the document is not linearized

### LINEARIZATION_STATUS_UNKNOWN

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
const val LINEARIZATION_STATUS_UNKNOWN = 2: Int
```

Indicates that the linearization status of the document could not be determined

### PAGE_INFO_EXCLUDE_FORM_WIDGETS

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
const val PAGE_INFO_EXCLUDE_FORM_WIDGETS = 0: Long
```

Flag used with `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getPageInfo(kotlin.Int)` to exclude any additional information in the returned `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.PageInfo`

### PAGE_INFO_INCLUDE_FORM_WIDGET

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
const val PAGE_INFO_INCLUDE_FORM_WIDGET: Long
```

Flag used with `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getPageInfo(kotlin.Int)` to include form widget metadata in the `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.PageInfo`

### PDF_FORM_TYPE_ACRO_FORM

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
const val PDF_FORM_TYPE_ACRO_FORM = 1: Int
```

Represents a PDF with form fields specified using the AcroForm spec

### PDF_FORM_TYPE_NONE

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
const val PDF_FORM_TYPE_NONE = 0: Int
```

Represents a PDF with no form fields

### PDF_FORM_TYPE_XFA_FOREGROUND

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
const val PDF_FORM_TYPE_XFA_FOREGROUND = 3: Int
```

Represents a PDF with form fields specified using the XFAF subset of the XFA spec

### PDF_FORM_TYPE_XFA_FULL

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
const val PDF_FORM_TYPE_XFA_FULL = 2: Int
```

Represents a PDF with form fields specified using the entire XFA spec

## Public functions

### addOnEditAppliedListener

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
@ExperimentalPdfApi
open fun addOnEditAppliedListener(
    executor: Executor,
    listener: PdfDocument.OnEditAppliedListener
): Unit
```

Adds a listener to be notified when an edit is applied on the document. Remove the listener using `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#removeOnEditAppliedListener(androidx.pdf.PdfDocument.OnEditAppliedListener)`.

| Parameters |
|---|---|
| `executor: https://developer.android.com/reference/java/util/concurrent/Executor.html` | The executor on which the listener's methods will be called. |
| `listener: https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.OnEditAppliedListener` | the listener to add. |

### addOnPdfContentInvalidatedListener

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
fun addOnPdfContentInvalidatedListener(
    executor: Executor,
    listener: PdfDocument.OnPdfContentInvalidatedListener
): Unit
```

Adds a listener to receive notifications when some regions of the PDF content are invalidated.

| Parameters |
|---|---|
| `executor: https://developer.android.com/reference/java/util/concurrent/Executor.html` | The executor on which the listener's methods will be called. |
| `listener: https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.OnPdfContentInvalidatedListener` | The listener to add. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.OnPdfContentInvalidatedListener` |   |

### getAnnotationsForPage

```
suspend fun getAnnotationsForPage(pageNum: Int): List<KeyedPdfAnnotation>
```

Retrieves a list of all annotations for the specified page.

| Parameters |
|---|---|
| `pageNum: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The page number (0-indexed) from which to retrieve edits. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/pdf/annotation/content/KeyedPdfAnnotation>` | A list of `https://developer.android.com/reference/kotlin/androidx/pdf/annotation/content/KeyedPdfAnnotation` objects on the page. Returns an empty list if there are no edits on the page. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if the page number is invalid. |

### getFormWidgetInfos

```
suspend fun getFormWidgetInfos(
    pageNum: Int,
    types: Long = FORM_WIDGET_INCLUDE_ALL_TYPES
): List<FormWidgetInfo>
```

Returns the list of `https://developer.android.com/reference/kotlin/androidx/pdf/models/FormWidgetInfo` on `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument#getFormWidgetInfos(kotlin.Int,kotlin.Long)`, optionally filtered by widget type.

| Parameters |
|---|---|
| `pageNum: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The page number (0-based). |
| `types: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html = FORM_WIDGET_INCLUDE_ALL_TYPES` | Bitmask to determine the types of form widgets to include in the result. Includes all types of form widgets by default. Value is either `0` or a combination of the following: - `-1` - `2` - `4` - `8` - `16` - `32` - `64` - `128` <br /> |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/pdf/models/FormWidgetInfo>` | A list of `https://developer.android.com/reference/kotlin/androidx/pdf/models/FormWidgetInfo` objects representing the form widgets of the specified types on the specified page. |

### getPageBitmapSource

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
fun getPageBitmapSource(pageNumber: Int): PdfDocument.BitmapSource
```

Gets a `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.BitmapSource` for retrieving bitmap representations of the specified page.

| Parameters |
|---|---|
| `pageNumber: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The page number (0-based). |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.BitmapSource` | A `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.BitmapSource` for the specified page, or null if the page number is invalid. |

### getPageContent

```
suspend fun getPageContent(pageNumber: Int): PdfDocument.PdfPageContent?
```

Asynchronously retrieves the content (text and images) of the specified page.

| Parameters |
|---|---|
| `pageNumber: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The page number (0-based). |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.PdfPageContent?` | A `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.PdfPageContent` object representing the page's content. |

### getPageInfo

```
suspend fun getPageInfo(pageNumber: Int): PdfDocument.PageInfo
```

Asynchronously retrieves information about the specified page.

| Parameters |
|---|---|
| `pageNumber: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The page number (0-based). |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.PageInfo` | A `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.PageInfo` object containing information about the page. |

### getPageInfo

```
suspend fun getPageInfo(
    pageNumber: Int,
    pageInfoFlags: Long = PAGE_INFO_EXCLUDE_FORM_WIDGETS
): PdfDocument.PageInfo
```

Asynchronously retrieves information about the specified page.

| Parameters |
|---|---|
| `pageNumber: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The page number (0-based). |
| `pageInfoFlags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html = PAGE_INFO_EXCLUDE_FORM_WIDGETS` | A bitmask for retrieving additional page information. Does not include any additional information by default. Value is either `0` or a combination of the following: - `0` - `1` <br /> |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.PageInfo` | A `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.PageInfo` object containing information about the page. |

### getPageInfos

```
suspend fun getPageInfos(pageRange: IntRange): List<PdfDocument.PageInfo>
```

Asynchronously retrieves information about a range of pages.

| Parameters |
|---|---|
| `pageRange: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.ranges/-int-range/index.html` | The range of page numbers (0-based, inclusive). |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.PageInfo>` | A list of `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.PageInfo` objects, one for each page in the range. |

### getPageInfos

```
suspend fun getPageInfos(
    pageRange: IntRange,
    pageInfoFlags: Long = PAGE_INFO_EXCLUDE_FORM_WIDGETS
): List<PdfDocument.PageInfo>
```

Asynchronously retrieves information about a range of pages.

| Parameters |
|---|---|
| `pageRange: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.ranges/-int-range/index.html` | The range of page numbers (0-based, inclusive). |
| `pageInfoFlags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html = PAGE_INFO_EXCLUDE_FORM_WIDGETS` | A bitmask for retrieving additional page information. Does not include any additional information by default. Value is either `0` or a combination of the following: - `0` - `1` <br /> |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.PageInfo>` | A list of `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.PageInfo` objects, one for each page in the range. |

### getPageLinks

```
suspend fun getPageLinks(pageNumber: Int): PdfDocument.PdfPageLinks
```

Asynchronously retrieves the links (Go To and external) present on the specified page.

| Parameters |
|---|---|
| `pageNumber: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The page number (0-based). |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.PdfPageLinks` | A `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.PdfPageLinks` object representing the page's links. |

### getSelectionBounds

```
suspend fun getSelectionBounds(pageNumber: Int, start: PointF, stop: PointF): PageSelection?
```

Asynchronously retrieves the selection bounds (in PDF coordinates) for the specified text selection.

| Parameters |
|---|---|
| `pageNumber: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The page on which text to be selected. |
| `start: https://developer.android.com/reference/android/graphics/PointF.html` | The starting point of the text selection. |
| `stop: https://developer.android.com/reference/android/graphics/PointF.html` | The ending point of the text selection. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/pdf/content/PageSelection?` | A `https://developer.android.com/reference/kotlin/androidx/pdf/content/PageSelection` object representing the selection bounds on the page. |

### removeOnEditAppliedListener

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
@ExperimentalPdfApi
open fun removeOnEditAppliedListener(
    listener: PdfDocument.OnEditAppliedListener
): Unit
```

Remove a listener for applied edits.

| Parameters |
|---|---|
| `listener: https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.OnEditAppliedListener` | the listener for notification of applied edit. |

### removeOnPdfContentInvalidatedListener

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
fun removeOnPdfContentInvalidatedListener(
    listener: PdfDocument.OnPdfContentInvalidatedListener
): Unit
```

Removes the listener from the list of listeners which are notified when some regions of the PDF content are invalidated.

| Parameters |
|---|---|
| `listener: https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.OnPdfContentInvalidatedListener` | The listener to remove. |

### searchDocument

```
suspend fun searchDocument(query: String, pageRange: IntRange): SparseArray<List<PageMatchBounds>>
```

Asynchronously searches the document for the specified query within a range of pages.

| Parameters |
|---|---|
| `query: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The search query string. |
| `pageRange: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.ranges/-int-range/index.html` | The range of page numbers (0-based, inclusive) to search within. |

| Returns |
|---|---|
| `https://developer.android.com/reference/android/util/SparseArray.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/pdf/content/PageMatchBounds>>` | A `https://developer.android.com/reference/android/util/SparseArray.html` mapping page numbers to lists of `https://developer.android.com/reference/kotlin/androidx/pdf/content/PageMatchBounds` objects representing the search results on each page. |

## Public properties

### formType

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
val formType: Int
```

The type of form present in the document.

Value is one of the following:

- `0`
- `1`
- `2`
- `3`

<br />

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.FormType` | for the supported types. |

### linearizationStatus

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
val linearizationStatus: Int
```

Indicates the linearization status of the document.

### pageCount

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
val pageCount: Int
```

The total number of pages in the document.

### renderParams

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
val renderParams: RenderParams
```

The render params used to determine the contents that will be rendered on the bitmap.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/pdf/RenderParams` |   |
| `https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument.BitmapSource#getBitmap(android.util.Size,android.graphics.Rect)` |   |

### uri

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
val uri: Uri
```

The URI of the document represented by this object