# OcrText

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

*** ** * ** ***


```
@ExperimentalPdfApi
class OcrText
```

<br />

*** ** * ** ***

Represents a segment of recognized text and its visual mapping in an image.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/pdf/ocr/OcrText#OcrText(kotlin.String,kotlin.collections.List)(text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, bounds: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/android/graphics/Rect.html>)` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/android/graphics/Rect.html>` | `https://developer.android.com/reference/kotlin/androidx/pdf/ocr/OcrText#bounds()` A list of `https://developer.android.com/reference/android/graphics/Rect.html` objects representing the visual bounding boxes of the text. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/ocr/OcrText#text()` The recognized string content. |

## Public constructors

### OcrText

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

```
OcrText(text: String, bounds: List<Rect>)
```

## Public properties

### bounds

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

```
val bounds: List<Rect>
```

A list of `https://developer.android.com/reference/android/graphics/Rect.html` objects representing the visual bounding boxes of the text. The bounds are typically aggregated by line to optimize for rendering and selection.

### text

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

```
val text: String
```

The recognized string content.