# PdfDocument.PageInfo.Builder

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

# Builder

*** ** * ** ***

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

```
class Builder
```

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

Builder for creating a[PageInfo](https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfDocument.PageInfo).

## Summary

|                                                                                                                                                                                                                                                Public constructors                                                                                                                                                                                                                                                 ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfDocument.PageInfo.Builder#Builder(kotlin.Int,%20kotlin.Int,%20kotlin.Int))`(`pageWidth:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `pageHeight:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `pageNumber:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Creates a new builder with the mandatory page info attributes. |

|                                                                                                                                                                                                                              Public methods                                                                                                                                                                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [PdfDocument.PageInfo](https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfDocument.PageInfo)!                  | [create](https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfDocument.PageInfo.Builder#create())`()` Creates a new[PageInfo](https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfDocument.PageInfo).                                                                                           |
| [PdfDocument.PageInfo.Builder](https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfDocument.PageInfo.Builder#)! | [setContentRect](https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfDocument.PageInfo.Builder#setContentRect(android.graphics.Rect))`(`contentRect:` `[Rect](https://developer.android.com/reference/kotlin/android/graphics/Rect.html#)!`)` Sets the content rectangle in PostScript point (1/72th of an inch). |

## Public constructors

### Builder

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

```
Builder(
    pageWidth: Int, 
    pageHeight: Int, 
    pageNumber: Int)
```

Creates a new builder with the mandatory page info attributes.

|                                                                 Parameters                                                                  ||
|--------------|-------------------------------------------------------------------------------------------------------------------------------|
| `pageWidth`  | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The page width in PostScript (1/72th of an inch).  |
| `pageHeight` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The page height in PostScript (1/72th of an inch). |
| `pageNumber` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The page number.                                   |

## Public methods

### create

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

```
fun create(): PdfDocument.PageInfo!
```

Creates a new[PageInfo](https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfDocument.PageInfo).

|                                                                Return                                                                ||
|-------------------------------------------------------------------------------------------------------------------|-------------------|
| [PdfDocument.PageInfo](https://developer.android.com/reference/kotlin/android/graphics/pdf/PdfDocument.PageInfo)! | The new instance. |

### setContentRect

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

```
fun setContentRect(contentRect: Rect!): PdfDocument.PageInfo.Builder!
```

Sets the content rectangle in PostScript point (1/72th of an inch). This is the area that contains the page content and is relative to the page top left.

|                                                                   Parameters                                                                    ||
|---------------|----------------------------------------------------------------------------------------------------------------------------------|
| `contentRect` | [Rect](https://developer.android.com/reference/kotlin/android/graphics/Rect.html#)!:The content rectangle. Must fit in the page. |