Skip to content

Most visited

Recently visited

navigation

PrintAttributes.Builder

public static final class PrintAttributes.Builder
extends Object

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


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.

Inherited methods

From class java.lang.Object

Public constructors

PrintAttributes.Builder

added in API level 19
PrintAttributes.Builder ()

Public methods

build

added in API level 19
PrintAttributes build ()

Creates a new PrintAttributes instance.

Returns
PrintAttributes The new instance.

This value will never be null.

setColorMode

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

Sets the color mode.

Parameters
colorMode int: A valid color mode or zero.

Returns
PrintAttributes.Builder This builder.

This value will never be null.

setDuplexMode

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

Sets the duplex mode.

Parameters
duplexMode int: A valid duplex mode or zero.

Returns
PrintAttributes.Builder This builder.

This value will never be null.

setMediaSize

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

Sets the media size.

Parameters
mediaSize PrintAttributes.MediaSize: The media size.

This value must never be null.

Returns
PrintAttributes.Builder This builder.

This value will never be null.

setMinMargins

added in API level 19
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 must never be null.

Returns
PrintAttributes.Builder This builder.

This value will never be null.

setResolution

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

Sets the resolution.

Parameters
resolution PrintAttributes.Resolution: The resolution.

This value must never be null.

Returns
PrintAttributes.Builder This builder.

This value will never be null.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)