Stay organized with collections
Save and categorize content based on your preferences.
public interface Selection
Represents PDF content that has been selected
Summary
Public methods
abstract @NonNull List<@NonNull PdfRect> getBounds()
The PdfRect
bounds of this selection. May contain multiple PdfRect
if this selection spans multiple discrete areas within the PDF. Consider for example any selection spanning multiple pages, or a text selection spanning multiple lines on the same page.
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-07-16 UTC.
[null,null,["Last updated 2025-07-16 UTC."],[],[],null,["# Selection\n=========\n\nArtifact: [androidx.pdf:pdf-viewer](/jetpack/androidx/releases/pdf) \n[View Source](https://cs.android.com/search?q=file:androidx/pdf/view/models.kt+class:androidx.pdf.view.Selection) \nAdded in [1.0.0-alpha10](/jetpack/androidx/releases/pdf#1.0.0-alpha10)\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/androidx/pdf/view/Selection \"View this page in Kotlin\") \\|Java\n\n\n```\npublic interface Selection\n```\n\n\u003cbr /\u003e\n\nKnown direct subclasses \n[TextSelection](/reference/androidx/pdf/view/TextSelection) \n\n|-------------------------------------------------------------|------------------------------------------------|\n| [TextSelection](/reference/androidx/pdf/view/TextSelection) | Represents text content that has been selected |\n\n*** ** * ** ***\n\nRepresents PDF content that has been selected\n\nSummary\n-------\n\n| ### Public methods |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|\n| `abstract @`[NonNull](/reference/androidx/annotation/NonNull)` `[List](https://developer.android.com/reference/java/util/List.html)`\u003c@`[NonNull](/reference/androidx/annotation/NonNull)` `[PdfRect](/reference/androidx/pdf/PdfRect)`\u003e` | [getBounds](/reference/androidx/pdf/view/Selection#getBounds())`()` The [PdfRect](/reference/androidx/pdf/PdfRect) bounds of this selection. |\n\nPublic methods\n--------------\n\n### getBounds\n\nAdded in [1.0.0-alpha10](/jetpack/androidx/releases/pdf#1.0.0-alpha10) \n\n```\nabstract @NonNull List\u003c@NonNull PdfRect\u003e getBounds()\n```\n\nThe [PdfRect](/reference/androidx/pdf/PdfRect) bounds of this selection. May contain multiple [PdfRect](/reference/androidx/pdf/PdfRect) if this selection spans multiple discrete areas within the PDF. Consider for example any selection spanning multiple pages, or a text selection spanning multiple lines on the same page."]]