PrintAttributes.Builder

public static final class PrintAttributes.Builder
extends Object

java.lang.Object
   ↳ android.print.PrintAttributes.Builder


Builder for creating PrintAttributes.

Summary

Public constructors

Builder()

Public methods

PrintAttributes build()

Creates a new PrintAttributes instance.

PrintAttributes.Builder setColorMode(int colorMode)

Sets the color mode.

PrintAttributes.Builder setDuplexMode(int duplexMode)

Sets the duplex mode.

PrintAttributes.Builder setMediaSize(PrintAttributes.MediaSize mediaSize)

Sets the media size.

PrintAttributes.Builder setMinMargins(PrintAttributes.Margins margins)

Sets the minimal margins.

PrintAttributes.Builder setResolution(PrintAttributes.Resolution resolution)

Sets the resolution.

Inherited methods

Public constructors

Builder

public Builder ()

Public methods

build

Added in API level 19
public PrintAttributes build ()

Creates a new PrintAttributes instance.

Returns
PrintAttributes The new instance. This value cannot be null.

setColorMode

Added in API level 19
public PrintAttributes.Builder setColorMode (int colorMode)

Sets the color mode.

Parameters
colorMode int: A valid color mode or zero. Value is either 0 or a combination of PrintAttributes.COLOR_MODE_MONOCHROME, and PrintAttributes.COLOR_MODE_COLOR

Returns
PrintAttributes.Builder This builder. This value cannot be null.

setDuplexMode

Added in API level 23
public PrintAttributes.Builder setDuplexMode (int duplexMode)

Sets the duplex mode.

Parameters
duplexMode int: A valid duplex mode or zero. Value is either 0 or a combination of PrintAttributes.DUPLEX_MODE_NONE, PrintAttributes.DUPLEX_MODE_LONG_EDGE, and PrintAttributes.DUPLEX_MODE_SHORT_EDGE

Returns
PrintAttributes.Builder This builder. This value cannot be null.

setMediaSize

Added in API level 19
public PrintAttributes.Builder setMediaSize (PrintAttributes.MediaSize mediaSize)

Sets the media size.

Parameters
mediaSize PrintAttributes.MediaSize: The media size. This value cannot be null.

Returns
PrintAttributes.Builder This builder. This value cannot be null.

setMinMargins

Added in API level 19
public PrintAttributes.Builder setMinMargins (PrintAttributes.Margins margins)

Sets the minimal margins. If the content does not fit these margins it will be clipped.

Parameters
margins PrintAttributes.Margins: The margins. This value cannot be null.

Returns
PrintAttributes.Builder This builder. This value cannot be null.

setResolution

Added in API level 19
public PrintAttributes.Builder setResolution (PrintAttributes.Resolution resolution)

Sets the resolution.

Parameters
resolution PrintAttributes.Resolution: The resolution. This value cannot be null.

Returns
PrintAttributes.Builder This builder. This value cannot be null.