Android APIs
public static final class

PrintAttributes.Builder

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

Class Overview

Builder for creating PrintAttributes.

Summary

Public Constructors
PrintAttributes.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.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public PrintAttributes.Builder ()

Added in API level 19

Public Methods

public PrintAttributes build ()

Added in API level 19

Creates a new PrintAttributes instance.

If you do not specify a duplex mode, the default DUPLEX_MODE_NONE will be used.

Returns
PrintAttributes The new instance.

public PrintAttributes.Builder setColorMode (int colorMode)

Added in API level 19

Sets the color mode.

Parameters
colorMode int: A valid color mode or zero.
Returns
PrintAttributes.Builder This builder.

public PrintAttributes.Builder setDuplexMode (int duplexMode)

Added in API level 23

Sets the duplex mode.

Parameters
duplexMode int: A valid duplex mode or zero.
Returns
PrintAttributes.Builder This builder.

public PrintAttributes.Builder setMediaSize (PrintAttributes.MediaSize mediaSize)

Added in API level 19

Sets the media size.

Parameters
mediaSize PrintAttributes.MediaSize: The media size.
Returns
PrintAttributes.Builder This builder.

public PrintAttributes.Builder setMinMargins (PrintAttributes.Margins margins)

Added in API level 19

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

Parameters
margins PrintAttributes.Margins: The margins.
Returns
PrintAttributes.Builder This builder.

public PrintAttributes.Builder setResolution (PrintAttributes.Resolution resolution)

Added in API level 19

Sets the resolution.

Parameters
resolution PrintAttributes.Resolution: The resolution.
Returns
PrintAttributes.Builder This builder.