# PrintDocumentInfo.Builder

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Ctors](https://developer.android.com/reference/android/print/PrintDocumentInfo.Builder#pubctors)\|[Methods](https://developer.android.com/reference/android/print/PrintDocumentInfo.Builder#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/print/PrintDocumentInfo.Builder#inhmethods)  

# PrintDocumentInfo.Builder

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/print/PrintDocumentInfo.Builder "View this page in Kotlin")\|Java

`
public
static
final

class
PrintDocumentInfo.Builder
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|-----------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.print.PrintDocumentInfo.Builder |

<br />

*** ** * ** ***

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

## Summary

|                                                                                                ### Public constructors                                                                                                ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[Builder](https://developer.android.com/reference/android/print/PrintDocumentInfo.Builder#Builder(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` name) ` Constructor. |

|                                                                                                                                                              ### Public methods                                                                                                                                                              ||
|-----------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[PrintDocumentInfo](https://developer.android.com/reference/android/print/PrintDocumentInfo)                 | ` `[build](https://developer.android.com/reference/android/print/PrintDocumentInfo.Builder#build())`() ` Creates a new[PrintDocumentInfo](https://developer.android.com/reference/android/print/PrintDocumentInfo)instance. |
| ` `[PrintDocumentInfo.Builder](https://developer.android.com/reference/android/print/PrintDocumentInfo.Builder) | ` `[setContentType](https://developer.android.com/reference/android/print/PrintDocumentInfo.Builder#setContentType(int))`(int type) ` Sets the content type.                                                                |
| ` `[PrintDocumentInfo.Builder](https://developer.android.com/reference/android/print/PrintDocumentInfo.Builder) | ` `[setPageCount](https://developer.android.com/reference/android/print/PrintDocumentInfo.Builder#setPageCount(int))`(int pageCount) ` Sets the total number of pages.                                                      |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Public constructors

### Builder

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

```
public Builder (String name)
```

Constructor.

The values of the relevant properties are initialized with defaults. Please refer to the documentation of the individual setters for information about the default values.

<br />

<br />

|                                                                                         Parameters                                                                                         ||
|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `name` | `String`: The document name which may be shown to the user and is the file name if the content it describes is saved as a PDF. Cannot be empty. This value cannot be`null`. <br /> |

## Public methods

### build

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

```
public PrintDocumentInfo build ()
```

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

<br />

|                                                                      Returns                                                                       ||
|----------------------------------------------------------------------------------------------|------------------------------------------------------|
| [PrintDocumentInfo](https://developer.android.com/reference/android/print/PrintDocumentInfo) | The new instance. This value cannot be`null`. <br /> |

### setContentType

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

```
public PrintDocumentInfo.Builder setContentType (int type)
```

Sets the content type.

**Default:** [PrintDocumentInfo.CONTENT_TYPE_DOCUMENT](https://developer.android.com/reference/android/print/PrintDocumentInfo#CONTENT_TYPE_DOCUMENT)

<br />

<br />

|                                                                                                                                                                                                                              Parameters                                                                                                                                                                                                                               ||
|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `type` | `int`: The content type. Value is[PrintDocumentInfo.CONTENT_TYPE_UNKNOWN](https://developer.android.com/reference/android/print/PrintDocumentInfo#CONTENT_TYPE_UNKNOWN),[PrintDocumentInfo.CONTENT_TYPE_DOCUMENT](https://developer.android.com/reference/android/print/PrintDocumentInfo#CONTENT_TYPE_DOCUMENT), or[PrintDocumentInfo.CONTENT_TYPE_PHOTO](https://developer.android.com/reference/android/print/PrintDocumentInfo#CONTENT_TYPE_PHOTO) <br /> |

|                                                                            Returns                                                                             ||
|--------------------------------------------------------------------------------------------------------------|--------------------------------------------------|
| [PrintDocumentInfo.Builder](https://developer.android.com/reference/android/print/PrintDocumentInfo.Builder) | This builder. This value cannot be`null`. <br /> |

**See also:**

- [PrintDocumentInfo.CONTENT_TYPE_UNKNOWN](https://developer.android.com/reference/android/print/PrintDocumentInfo#CONTENT_TYPE_UNKNOWN)
- [PrintDocumentInfo.CONTENT_TYPE_DOCUMENT](https://developer.android.com/reference/android/print/PrintDocumentInfo#CONTENT_TYPE_DOCUMENT)
- [PrintDocumentInfo.CONTENT_TYPE_PHOTO](https://developer.android.com/reference/android/print/PrintDocumentInfo#CONTENT_TYPE_PHOTO)  

### setPageCount

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

```
public PrintDocumentInfo.Builder setPageCount (int pageCount)
```

Sets the total number of pages.

**Default:** [PrintDocumentInfo.PAGE_COUNT_UNKNOWN](https://developer.android.com/reference/android/print/PrintDocumentInfo#PAGE_COUNT_UNKNOWN)

<br />

<br />

|                                                                                                                     Parameters                                                                                                                     ||
|-------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `pageCount` | `int`: The number of pages. Must be greater than or equal to zero or[PrintDocumentInfo.PAGE_COUNT_UNKNOWN](https://developer.android.com/reference/android/print/PrintDocumentInfo#PAGE_COUNT_UNKNOWN). Value is -1 or greater <br /> |

|                                                                            Returns                                                                             ||
|--------------------------------------------------------------------------------------------------------------|--------------------------------------------------|
| [PrintDocumentInfo.Builder](https://developer.android.com/reference/android/print/PrintDocumentInfo.Builder) | This builder. This value cannot be`null`. <br /> |