Added in API level 19

PrintJobInfo


class PrintJobInfo : Parcelable
kotlin.Any
   ↳ android.print.PrintJobInfo

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

Builder for creating a PrintJobInfo.

Constants
static Int

Print job state: The print job is blocked.

static Int

Print job state: The print job is canceled.

static Int

Print job state: The print job is successfully printed.

static Int

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

static Int

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

static Int

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

static Int

Print job state: The print job is being printed.

Inherited constants
Public methods
Int

Int

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

String!

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

PrintAttributes

Gets the print job attributes.

Int

Gets the number of copies.

Long

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

PrintJobId?

Gets the unique print job id.

String

Gets the human readable job label.

Array<PageRange!>?

Gets the included pages.

PrinterId?

Gets the unique target printer id.

Int

Gets the current job state.

Boolean

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

String

Unit
writeToParcel(parcel: Parcel, flags: Int)

Properties
static Parcelable.Creator<PrintJobInfo!>

Constants

STATE_BLOCKED

Added in API level 19
static val STATE_BLOCKED: Int

Print job state: The print job is blocked.

Next valid states: STATE_FAILED, STATE_CANCELED, STATE_STARTED

Value: 4

STATE_CANCELED

Added in API level 19
static val STATE_CANCELED: Int

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

Next valid states: None

Value: 7

STATE_COMPLETED

Added in API level 19
static val STATE_COMPLETED: Int

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

Next valid states: None

Value: 5

STATE_CREATED

Added in API level 19
static val STATE_CREATED: Int

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

Next valid states: STATE_QUEUED

Value: 1

STATE_FAILED

Added in API level 19
static val STATE_FAILED: Int

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

Next valid states: STATE_CANCELED, STATE_STARTED

Value: 6

STATE_QUEUED

Added in API level 19
static val STATE_QUEUED: Int

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

Next valid states: STATE_STARTED, STATE_FAILED, STATE_CANCELED

Value: 2

STATE_STARTED

Added in API level 19
static val STATE_STARTED: Int

Print job state: The print job is being printed.

Next valid states: STATE_COMPLETED, STATE_FAILED, STATE_CANCELED, STATE_BLOCKED

Value: 3

Public methods

describeContents

Added in API level 19
fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

getAdvancedIntOption

Added in API level 26
fun getAdvancedIntOption(key: String!): Int

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

Parameters
key String!: The option key.
Return
Int The option value.

getAdvancedStringOption

Added in API level 26
fun getAdvancedStringOption(key: String!): String!

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

Parameters
key String!: The option key.
Return
String! The option value.

getAttributes

Added in API level 19
fun getAttributes(): PrintAttributes

Gets the print job attributes.

Return
PrintAttributes The attributes. This value cannot be null.

getCopies

Added in API level 19
fun getCopies(): Int

Gets the number of copies.

Return
Int The number of copies or zero if not set. Value is 0 or greater

getCreationTime

Added in API level 19
fun getCreationTime(): Long

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

Return
Long The creation time in milliseconds.

getId

Added in API level 19
fun getId(): PrintJobId?

Gets the unique print job id.

Return
PrintJobId? The id. This value may be null.

getLabel

Added in API level 19
fun getLabel(): String

Gets the human readable job label.

Return
String The label. This value cannot be null.

getPages

Added in API level 19
fun getPages(): Array<PageRange!>?

Gets the included pages.

Return
Array<PageRange!>? The included pages or null if not set.

getPrinterId

Added in API level 19
fun getPrinterId(): PrinterId?

Gets the unique target printer id.

Return
PrinterId? The target printer id. This value may be null.

hasAdvancedOption

Added in API level 26
fun hasAdvancedOption(key: String!): Boolean

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

Parameters
key String!: The option key.
Return
Boolean Whether the option is present.

toString

Added in API level 19
fun toString(): String
Return
String a string representation of the object.

writeToParcel

Added in API level 19
fun writeToParcel(
    parcel: Parcel,
    flags: Int
): Unit
Parameters
dest The Parcel in which the object should be written. This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 19
static val CREATOR: Parcelable.Creator<PrintJobInfo!>