# PrintJobInfo.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/print/PrintJobInfo.Builder "View this page in Java")  

```
class Builder
```

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

Builder for creating a[PrintJobInfo](https://developer.android.com/reference/kotlin/android/print/PrintJobInfo).

## Summary

|                                                                                                                      Public constructors                                                                                                                      ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/print/PrintJobInfo.Builder#Builder(android.print.PrintJobInfo))`(`prototype:` `[PrintJobInfo](https://developer.android.com/reference/kotlin/android/print/PrintJobInfo)?`)` Constructor. |

|                                                                                                                                                                                                                                       Public methods                                                                                                                                                                                                                                       ||
|-------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [PrintJobInfo](https://developer.android.com/reference/kotlin/android/print/PrintJobInfo) | [build](https://developer.android.com/reference/kotlin/android/print/PrintJobInfo.Builder#build())`()` Creates a new[PrintJobInfo](https://developer.android.com/reference/kotlin/android/print/PrintJobInfo)instance.                                                                                                                                                                          |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)              | [putAdvancedOption](https://developer.android.com/reference/kotlin/android/print/PrintJobInfo.Builder#putAdvancedOption(kotlin.String,%20kotlin.Int))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `value:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Puts an advanced (printer specific) option.           |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)              | [putAdvancedOption](https://developer.android.com/reference/kotlin/android/print/PrintJobInfo.Builder#putAdvancedOption(kotlin.String,%20kotlin.String))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `value:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?`)` Puts an advanced (printer specific) option. |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)              | [setAttributes](https://developer.android.com/reference/kotlin/android/print/PrintJobInfo.Builder#setAttributes(android.print.PrintAttributes))`(`attributes:` `[PrintAttributes](https://developer.android.com/reference/kotlin/android/print/PrintAttributes)`)` Sets the print job attributes.                                                                                               |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)              | [setCopies](https://developer.android.com/reference/kotlin/android/print/PrintJobInfo.Builder#setCopies(kotlin.Int))`(`copies:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the number of copies.                                                                                                                                                       |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)              | [setPages](https://developer.android.com/reference/kotlin/android/print/PrintJobInfo.Builder#setPages(kotlin.Array))`(`pages:` `[Array](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)<[PageRange](https://developer.android.com/reference/kotlin/android/print/PageRange)!>`)` Sets the included pages.                                                                |

## Public constructors

### Builder

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

```
Builder(prototype: PrintJobInfo?)
```

Constructor.

|                                                                         Parameters                                                                          ||
|-------------|------------------------------------------------------------------------------------------------------------------------------------------------|
| `prototype` | [PrintJobInfo](https://developer.android.com/reference/kotlin/android/print/PrintJobInfo)?:Prototype to use as a starting point. Can be`null`. |

## Public methods

### build

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

```
fun build(): PrintJobInfo
```

Creates a new[PrintJobInfo](https://developer.android.com/reference/kotlin/android/print/PrintJobInfo)instance.

|                                                                  Return                                                                  ||
|-------------------------------------------------------------------------------------------|-----------------------------------------------|
| [PrintJobInfo](https://developer.android.com/reference/kotlin/android/print/PrintJobInfo) | The new instance. This value cannot be`null`. |

### putAdvancedOption

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

```
fun putAdvancedOption(
    key: String, 
    value: Int
): Unit
```

Puts an advanced (printer specific) option.

|                                                              Parameters                                                               ||
|---------|------------------------------------------------------------------------------------------------------------------------------|
| `key`   | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):The option key. This value cannot be`null`. |
| `value` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The option value.                                 |

### putAdvancedOption

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

```
fun putAdvancedOption(
    key: String, 
    value: String?
): Unit
```

Puts an advanced (printer specific) option.

|                                                              Parameters                                                               ||
|---------|------------------------------------------------------------------------------------------------------------------------------|
| `key`   | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):The option key. This value cannot be`null`. |
| `value` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?:The option value. This value may be`null`. |

### setAttributes

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

```
fun setAttributes(attributes: PrintAttributes): Unit
```

Sets the print job attributes.

|                                                                        Parameters                                                                         ||
|--------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| `attributes` | [PrintAttributes](https://developer.android.com/reference/kotlin/android/print/PrintAttributes):The attributes. This value cannot be`null`. |

### setCopies

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

```
fun setCopies(copies: Int): Unit
```

Sets the number of copies.

|                                                            Parameters                                                            ||
|----------|------------------------------------------------------------------------------------------------------------------------|
| `copies` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The number of copies. Value is 1 or greater |

### setPages

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

```
fun setPages(pages: Array<PageRange!>): Unit
```

Sets the included pages.

|                                                                                                           Parameters                                                                                                            ||
|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `pages` | [Array](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)\<[PageRange](https://developer.android.com/reference/kotlin/android/print/PageRange)!\>:The included pages. This value cannot be`null`. |