Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/print/PrintJobInfo#nestedclasses) \| [Constants](https://developer.android.com/reference/android/print/PrintJobInfo#constants) \| [Inherited Constants](https://developer.android.com/reference/android/print/PrintJobInfo#inhconstants) \| [Fields](https://developer.android.com/reference/android/print/PrintJobInfo#lfields) \| [Methods](https://developer.android.com/reference/android/print/PrintJobInfo#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/print/PrintJobInfo#inhmethods)

# PrintJobInfo

*** ** * ** ***

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


`
public

final

class
PrintJobInfo
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


implements

https://developer.android.com/reference/android/os/Parcelable


`

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

<br />

*** ** * ** ***

This class represents the description of a print job. The print job
state includes properties such as its id, print attributes used for
generating the content, and so on. Note that the print jobs state may
change over time and this class represents a snapshot of this state.

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/print/PrintJobInfo.Builder` Builder for creating a `https://developer.android.com/reference/android/print/PrintJobInfo`. |

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_BLOCKED` Print job state: The print job is blocked. |
| `int` | `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_CANCELED` Print job state: The print job is canceled. |
| `int` | `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_COMPLETED` Print job state: The print job is successfully printed. |
| `int` | `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_CREATED` Print job state: The print job is being created but not yet ready to be printed. |
| `int` | `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_FAILED` Print job state: The print job was printing but printing failed. |
| `int` | `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_QUEUED` Print job state: The print jobs is created, it is ready to be printed and should be processed. |
| `int` | `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_STARTED` Print job state: The print job is being printed. |

| ### Inherited constants |
|---|
| From interface `https://developer.android.com/reference/android/os/Parcelable` |---|---| | `int` | `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` Descriptor bit used with `https://developer.android.com/reference/android/os/Parcelable#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor. | | `int` | `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` Flag for use with `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`: the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". | |

| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/os/Parcelable.Creator<https://developer.android.com/reference/android/print/PrintJobInfo>` | `https://developer.android.com/reference/android/print/PrintJobInfo#CREATOR` |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/print/PrintJobInfo#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| ` int` | ` https://developer.android.com/reference/android/print/PrintJobInfo#getAdvancedIntOption(java.lang.String)(https://developer.android.com/reference/java/lang/String key) ` Gets the value of an advanced (printer specific) print option. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/print/PrintJobInfo#getAdvancedStringOption(java.lang.String)(https://developer.android.com/reference/java/lang/String key) ` Gets the value of an advanced (printer specific) print option. |
| ` https://developer.android.com/reference/android/print/PrintAttributes` | ` https://developer.android.com/reference/android/print/PrintJobInfo#getAttributes()() ` Gets the print job attributes. |
| ` int` | ` https://developer.android.com/reference/android/print/PrintJobInfo#getCopies()() ` Gets the number of copies. |
| ` long` | ` https://developer.android.com/reference/android/print/PrintJobInfo#getCreationTime()() ` Gets the wall time in millisecond when this print job was created. |
| ` https://developer.android.com/reference/android/print/PrintJobId` | ` https://developer.android.com/reference/android/print/PrintJobInfo#getId()() ` Gets the unique print job id. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/print/PrintJobInfo#getLabel()() ` Gets the human readable job label. |
| ` https://developer.android.com/reference/android/print/PageRange` | ` https://developer.android.com/reference/android/print/PrintJobInfo#getPages()() ` Gets the included pages. |
| ` https://developer.android.com/reference/android/print/PrinterId` | ` https://developer.android.com/reference/android/print/PrintJobInfo#getPrinterId()() ` Gets the unique target printer id. |
| ` int` | ` https://developer.android.com/reference/android/print/PrintJobInfo#getState()() ` Gets the current job state. |
| ` boolean` | ` https://developer.android.com/reference/android/print/PrintJobInfo#hasAdvancedOption(java.lang.String)(https://developer.android.com/reference/java/lang/String key) ` Gets whether this job has a given advanced (printer specific) print option. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/print/PrintJobInfo#toString()() ` Returns a string representation of the object. |
| ` void` | ` https://developer.android.com/reference/android/print/PrintJobInfo#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel parcel, int flags) ` Flatten this object in to a Parcel. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` 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 https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` 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` | ` 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` | ` 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*. | ||
| From interface ` https://developer.android.com/reference/android/os/Parcelable ` |---|---| | ` abstract int` | ` https://developer.android.com/reference/android/os/Parcelable#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. | | ` abstract void` | ` https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) ` Flatten this object in to a Parcel. | ||

## Constants

### STATE_BLOCKED

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

```
public static final int STATE_BLOCKED
```

Print job state: The print job is blocked.


Next valid states: `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_FAILED`, `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_CANCELED`,
`https://developer.android.com/reference/android/print/PrintJobInfo#STATE_STARTED`

<br />

<br />

Constant Value:

4
(0x00000004)


### STATE_CANCELED

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

```
public static final int STATE_CANCELED
```

Print job state: The print job is canceled.
This is a terminal state.


Next valid states: None

<br />

<br />

Constant Value:

7
(0x00000007)


### STATE_COMPLETED

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

```
public static final int STATE_COMPLETED
```

Print job state: The print job is successfully printed.
This is a terminal state.


Next valid states: None

<br />

<br />

Constant Value:

5
(0x00000005)


### STATE_CREATED

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

```
public static final int STATE_CREATED
```

Print job state: The print job is being created but not yet
ready to be printed.


Next valid states: `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_QUEUED`

<br />

<br />

Constant Value:

1
(0x00000001)


### STATE_FAILED

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

```
public static final int STATE_FAILED
```

Print job state: The print job was printing but printing failed.


Next valid states: `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_CANCELED`, `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_STARTED`

<br />

<br />

Constant Value:

6
(0x00000006)


### STATE_QUEUED

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

```
public static final int STATE_QUEUED
```

Print job state: The print jobs is created, it is ready
to be printed and should be processed.


Next valid states: `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_STARTED`, `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_FAILED`,
`https://developer.android.com/reference/android/print/PrintJobInfo#STATE_CANCELED`

<br />

<br />

Constant Value:

2
(0x00000002)


### STATE_STARTED

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

```
public static final int STATE_STARTED
```

Print job state: The print job is being printed.


Next valid states: `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_COMPLETED`, `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_FAILED`,
`https://developer.android.com/reference/android/print/PrintJobInfo#STATE_CANCELED`, `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_BLOCKED`

<br />

<br />

Constant Value:

3
(0x00000003)


## Fields

### CREATOR

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

```
public static final Creator<PrintJobInfo> CREATOR
```

<br />

<br />

## Public methods

### describeContents

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

```
public int describeContents ()
```

Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation. For example, if the object will
include a file descriptor in the output of `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`,
the return value of this method must include the
`https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` bit.

<br />

| Returns ||
|---|---|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` |

### getAdvancedIntOption

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

```
public int getAdvancedIntOption (String key)
```

Gets the value of an advanced (printer specific) print option.

<br />

| Parameters ||
|---|---|
| `key` | `String`: The option key. <br /> |

| Returns ||
|---|---|
| `int` | The option value. <br /> |

### getAdvancedStringOption

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

```
public String getAdvancedStringOption (String key)
```

Gets the value of an advanced (printer specific) print option.

<br />

| Parameters ||
|---|---|
| `key` | `String`: The option key. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | The option value. <br /> |

### getAttributes

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

```
public PrintAttributes getAttributes ()
```

Gets the print job attributes.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/print/PrintAttributes` | The attributes. This value cannot be `null`. <br /> |

### getCopies

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

```
public int getCopies ()
```

Gets the number of copies.

<br />

| Returns ||
|---|---|
| `int` | The number of copies or zero if not set. Value is 0 or greater <br /> |

### getCreationTime

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

```
public long getCreationTime ()
```

Gets the wall time in millisecond when this print job was created.

<br />

| Returns ||
|---|---|
| `long` | The creation time in milliseconds. <br /> |

### getId

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

```
public PrintJobId getId ()
```

Gets the unique print job id.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/print/PrintJobId` | The id. This value may be `null`. <br /> |

### getLabel

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

```
public String getLabel ()
```

Gets the human readable job label.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | The label. This value cannot be `null`. <br /> |

### getPages

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

```
public PageRange[] getPages ()
```

Gets the included pages.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/print/PageRange` | The included pages or `null` if not set. <br /> |

### getPrinterId

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

```
public PrinterId getPrinterId ()
```

Gets the unique target printer id.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/print/PrinterId` | The target printer id. This value may be `null`. <br /> |

### getState

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

```
public int getState ()
```

Gets the current job state.

<br />

| Returns ||
|---|---|
| `int` | The job state. Value is one of the following: - `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_CREATED` - `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_QUEUED` - `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_STARTED` - `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_BLOCKED` - `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_COMPLETED` - `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_FAILED` - `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_CANCELED` |

**See also:**

- `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_CREATED`
- `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_QUEUED`
- `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_STARTED`
- `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_COMPLETED`
- `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_BLOCKED`
- `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_FAILED`
- `https://developer.android.com/reference/android/print/PrintJobInfo#STATE_CANCELED`

### hasAdvancedOption

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

```
public boolean hasAdvancedOption (String key)
```

Gets whether this job has a given advanced (printer specific) print
option.

<br />

| Parameters ||
|---|---|
| `key` | `String`: The option key. <br /> |

| Returns ||
|---|---|
| `boolean` | Whether the option is present. <br /> |

### toString

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

```
public String toString ()
```

Returns a string representation of the object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |

### writeToParcel

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

```
public void writeToParcel (Parcel parcel, 
                int flags)
```

Flatten this object in to a Parcel.

<br />

| Parameters ||
|---|---|
| `parcel` | `Parcel`: The Parcel in which the object should be written. This value cannot be `null`. <br /> |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` |