# PdfViewportState

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

*** ** * ** ***


```
class PdfViewportState
```

<br />

*** ** * ** ***

Represents the state of the viewport on which `https://developer.android.com/reference/kotlin/androidx/pdf/view/PdfView` is overlaid.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/pdf/annotation/PdfViewportState#PdfViewportState(kotlin.Int,kotlin.Int,android.util.SparseArray,kotlin.Float)( firstVisiblePage: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, visiblePagesCount: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, pageBounds: https://developer.android.com/reference/android/util/SparseArray.html<https://developer.android.com/reference/android/graphics/RectF.html>, zoom: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/annotation/PdfViewportState#firstVisiblePage()` The index of the first visible page 0-based. |
| `https://developer.android.com/reference/android/util/SparseArray.html<https://developer.android.com/reference/android/graphics/RectF.html>` | `https://developer.android.com/reference/kotlin/androidx/pdf/annotation/PdfViewportState#pageBounds()` A mapping of page numbers to their bounds in view coordinates. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/annotation/PdfViewportState#visiblePagesCount()` The number of currently visible pages. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/annotation/PdfViewportState#zoom()` The current zoom level of the PDF. |

## Public constructors

### PdfViewportState

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

```
PdfViewportState(
    firstVisiblePage: Int,
    visiblePagesCount: Int,
    pageBounds: SparseArray<RectF>,
    zoom: Float
)
```

| Parameters |
|---|---|
| `firstVisiblePage: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The index of the first visible page 0-based. |
| `visiblePagesCount: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The number of currently visible pages. |
| `pageBounds: https://developer.android.com/reference/android/util/SparseArray.html<https://developer.android.com/reference/android/graphics/RectF.html>` | A mapping of page numbers to their bounds in view coordinates. |
| `zoom: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The current zoom level of the PDF. |

## Public properties

### firstVisiblePage

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

```
val firstVisiblePage: Int
```

The index of the first visible page 0-based.

### pageBounds

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

```
val pageBounds: SparseArray<RectF>
```

A mapping of page numbers to their bounds in view coordinates.

### visiblePagesCount

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

```
val visiblePagesCount: Int
```

The number of currently visible pages.

### zoom

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

```
val zoom: Float
```

The current zoom level of the PDF.