Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
Builder for creating a PrintDocumentInfo
.
Summary
Public constructors |
Constructor.
|
Public constructors
Builder
Builder(name: String)
Constructor.
The values of the relevant properties are initialized with defaults. Please refer to the documentation of the individual setters for information about the default values.
Parameters |
name |
String: The document name which may be shown to the user and is the file name if the content it describes is saved as a PDF. Cannot be empty. This value cannot be null . |
Public methods
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# PrintDocumentInfo.Builder\n\nAdded in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/print/PrintDocumentInfo.Builder \"View this page in Java\") \n\n```\nclass Builder\n```\n\n|---|----------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.print.PrintDocumentInfo.Builder](#) |\n\nBuilder for creating a [PrintDocumentInfo](/reference/kotlin/android/print/PrintDocumentInfo).\n\nSummary\n-------\n\n| Public constructors ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [Builder](#Builder(kotlin.String))`(`name:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Constructor. |\n\n| Public methods ||\n|------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [PrintDocumentInfo](/reference/kotlin/android/print/PrintDocumentInfo) | [build](#build())`()` Creates a new [PrintDocumentInfo](/reference/kotlin/android/print/PrintDocumentInfo) instance. |\n| [PrintDocumentInfo.Builder](#) | [setContentType](#setContentType(kotlin.Int))`(`type:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the content type. |\n| [PrintDocumentInfo.Builder](#) | [setPageCount](#setPageCount(kotlin.Int))`(`pageCount:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the total number of pages. |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder(name: String)\n```\n\nConstructor.\n\nThe values of the relevant properties are initialized with defaults. Please refer to the documentation of the individual setters for information about the default values.\n\n| Parameters ||\n|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): The document name which may be shown to the user and is the file name if the content it describes is saved as a PDF. Cannot be empty. This value cannot be `null`. |\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun build(): PrintDocumentInfo\n```\n\nCreates a new [PrintDocumentInfo](/reference/kotlin/android/print/PrintDocumentInfo) instance.\n\n| Return ||\n|------------------------------------------------------------------------|------------------------------------------------|\n| [PrintDocumentInfo](/reference/kotlin/android/print/PrintDocumentInfo) | The new instance. This value cannot be `null`. |\n\n### setContentType\n\nAdded in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setContentType(type: Int): PrintDocumentInfo.Builder\n```\n\nSets the content type.\n\n**Default:** [CONTENT_TYPE_DOCUMENT](/reference/kotlin/android/print/PrintDocumentInfo#CONTENT_TYPE_DOCUMENT:kotlin.Int)\n\n| Parameters ||\n|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `type` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The content type. Value is [android.print.PrintDocumentInfo#CONTENT_TYPE_UNKNOWN](/reference/kotlin/android/print/PrintDocumentInfo#CONTENT_TYPE_UNKNOWN:kotlin.Int), [android.print.PrintDocumentInfo#CONTENT_TYPE_DOCUMENT](/reference/kotlin/android/print/PrintDocumentInfo#CONTENT_TYPE_DOCUMENT:kotlin.Int), or [android.print.PrintDocumentInfo#CONTENT_TYPE_PHOTO](/reference/kotlin/android/print/PrintDocumentInfo#CONTENT_TYPE_PHOTO:kotlin.Int) |\n\n| Return ||\n|--------------------------------|--------------------------------------------|\n| [PrintDocumentInfo.Builder](#) | This builder. This value cannot be `null`. |\n\n**See Also**\n\n- [#CONTENT_TYPE_UNKNOWN](/reference/kotlin/android/print/PrintDocumentInfo#CONTENT_TYPE_UNKNOWN:kotlin.Int)\n- [#CONTENT_TYPE_DOCUMENT](/reference/kotlin/android/print/PrintDocumentInfo#CONTENT_TYPE_DOCUMENT:kotlin.Int)\n- [#CONTENT_TYPE_PHOTO](/reference/kotlin/android/print/PrintDocumentInfo#CONTENT_TYPE_PHOTO:kotlin.Int) \n\n### setPageCount\n\nAdded in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setPageCount(pageCount: Int): PrintDocumentInfo.Builder\n```\n\nSets the total number of pages.\n\n**Default:** [PAGE_COUNT_UNKNOWN](/reference/kotlin/android/print/PrintDocumentInfo#PAGE_COUNT_UNKNOWN:kotlin.Int)\n\n| Parameters ||\n|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `pageCount` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The number of pages. Must be greater than or equal to zero or [PrintDocumentInfo.PAGE_COUNT_UNKNOWN](/reference/kotlin/android/print/PrintDocumentInfo#PAGE_COUNT_UNKNOWN:kotlin.Int). Value is -1 or greater |\n\n| Return ||\n|--------------------------------|--------------------------------------------|\n| [PrintDocumentInfo.Builder](#) | This builder. This value cannot be `null`. |"]]