Stay organized with collections
Save and categorize content based on your preferences.
Page
class Page
This class represents a PDF document page. It has associated a canvas on which you can draw content and is acquired by a call to getCanvas()
. It also has associated a PageInfo
instance that describes its attributes. Also a page has
Summary
Public methods
getCanvas
fun getCanvas(): Canvas!
Gets the Canvas
of the page.
Note: There are some draw operations that are not yet supported by the canvas returned by this method. More specifically:
Return |
Canvas! |
The canvas if the page is not finished, null otherwise. |
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,["# PdfDocument.Page\n\nAdded in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nPage\n====\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/graphics/pdf/PdfDocument.Page \"View this page in Java\") \n\n```\nclass Page\n```\n\n|---|--------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.graphics.pdf.PdfDocument.Page](#) |\n\nThis class represents a PDF document page. It has associated a canvas on which you can draw content and is acquired by a call to [getCanvas()](#getCanvas()). It also has associated a [PageInfo](/reference/kotlin/android/graphics/pdf/PdfDocument.PageInfo) instance that describes its attributes. Also a page has\n\nSummary\n-------\n\n| Public methods ||\n|--------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|\n| [Canvas](../Canvas.html#)! | [getCanvas](#getCanvas())`()` Gets the [Canvas](../Canvas.html#) of the page. |\n| [PdfDocument.PageInfo](/reference/kotlin/android/graphics/pdf/PdfDocument.PageInfo)! | [getInfo](#getInfo())`()` Gets the [PageInfo](/reference/kotlin/android/graphics/pdf/PdfDocument.PageInfo) with meta-data for the page. |\n\nPublic methods\n--------------\n\n### getCanvas\n\nAdded in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getCanvas(): Canvas!\n```\n\nGets the [Canvas](../Canvas.html#) of the page.\n\n**Note:** There are some draw operations that are not yet supported by the canvas returned by this method. More specifically:\n\n- Inverse path clipping performed via [android.graphics.Region.Op)](../Canvas.html#clipPath(android.graphics.Path,%20android.graphics.Region.Op)) for [Region.Op#REVERSE_DIFFERENCE](../Region.Op.html#) operations.\n- [int, int[], int, short[], int, int, android.graphics.Paint)](../Canvas.html#drawVertices(android.graphics.Canvas.VertexMode,%20kotlin.Int,%20kotlin.FloatArray,%20kotlin.Int,%20kotlin.FloatArray,%20kotlin.Int,%20kotlin.IntArray,%20kotlin.Int,%20kotlin.ShortArray,%20kotlin.Int,%20kotlin.Int,%20android.graphics.Paint))\n- Color filters set via [Paint.setColorFilter(](../Paint.html#setColorFilter(android.graphics.ColorFilter))\n- Mask filters set via [Paint.setMaskFilter(](../Paint.html#setMaskFilter(android.graphics.MaskFilter))\n- Some XFER modes such as [PorterDuff.Mode SRC](../PorterDuff.Mode.html#), [PorterDuff.DST_ATOP](../PorterDuff.Mode.html#), [PorterDuff.XOR](../PorterDuff.Mode.html#), [PorterDuff.ADD](../PorterDuff.Mode.html#)\n\n| Return ||\n|----------------------------|---------------------------------------------------------|\n| [Canvas](../Canvas.html#)! | The canvas if the page is not finished, null otherwise. |\n\n**See Also**\n\n- [android.graphics.pdf.PdfDocument#finishPage(Page)](/reference/kotlin/android/graphics/pdf/PdfDocument#finishPage(android.graphics.pdf.PdfDocument.Page)) \n\n### getInfo\n\nAdded in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getInfo(): PdfDocument.PageInfo!\n```\n\nGets the [PageInfo](/reference/kotlin/android/graphics/pdf/PdfDocument.PageInfo) with meta-data for the page.\n\n| Return ||\n|--------------------------------------------------------------------------------------|----------------|\n| [PdfDocument.PageInfo](/reference/kotlin/android/graphics/pdf/PdfDocument.PageInfo)! | The page info. |\n\n**See Also**\n\n- [android.graphics.pdf.PdfDocument#finishPage(Page)](/reference/kotlin/android/graphics/pdf/PdfDocument#finishPage(android.graphics.pdf.PdfDocument.Page))"]]