---
title: "Jetpack Compose and DocumentView Q&A"
canonical_url: "https://www.nutrient.io/guides/android/knowledge-base/compose-qna/"
md_url: "https://www.nutrient.io/guides/android/knowledge-base/compose-qna.md"
last_updated: "2026-05-15T19:10:04.908Z"
description: "This guide answers some questions you might face when using Jetpack Compose with Nutrient Android SDK."
---

This guide answers some questions you might face when using Jetpack Compose with Nutrient Android SDK.

## Hiding page numbers

**Q: How can I make the page numeration label vanish when a page is changed?**

**A:** You can rely on the [`hidePageNumberOverlay`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.configuration.activity/-pdf-activity-configuration/-builder/page-number-overlay-enabled.html) option for that!

## Summoning page overviews

**Q: How do I show page overviews programmatically?**

**A:** This is possible with the [`toggleView`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.jetpack.compose.interactors/-document-state/toggle-view.html) function.

With toggle view, you can switch to any view, like search, outline, document info, etc.

The page overview is `PdfThumbnailGrid`, which can be displayed dynamically using the `toggleView` function from `documentState`, as seen in `documentState.toggleView(PdfActivity.MENU_OPTION_THUMBNAIL_GRID)`.

## Creating dynamic annotations with Compose

**Q: Can I dynamically add annotations using Jetpack Compose, similar to the [Fragment examples](https://www.nutrient.io/guides/android/annotations/programmatically-creating-annotations.md)?**

**A:** The `DocumentState` has a reference to `documentConnectionof` of type [`DocumentConnection`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.jetpack.compose.interactors/-document-connection/index.html) that provides this method to [`addAnnotationToPage`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.jetpack.compose.interactors/-document-connection/add-annotation-to-page.html). Under the hood, this calls `PdfFragment.addAnnotationToPage`.

## Opening AES-encrypted PDFs

**Q: How can I open an AES-encrypted PDF using Jetpack Compose?**

**A:** Ideally, the PDF should open the `pdfActivity` from a Compose callback. However, our current Compose `DocumentView` doesn’t yet support providers as an input. As a result, this has been categorized as a feature request. While we cannot guarantee if and when these changes will be implemented, we carefully consider all requests that are submitted.

Moreover, if you wish to avoid using `PdfActivity`, you’ll need to decrypt the PDF on your own and pass the URL in our Compose document view. The code provided in the Compose callback should be effective for your needs:

```kotlin

val provider = AesDataProvider( documentFile.absolutePath,
AesEncryptedFileExample.BASE64_ENCRYPTION_KEY)
val intent = PdfActivityIntentBuilder.fromDataProvider(context, provider).configuration(pdfActivityConfiguration).build()
                                   context.startActivity(intent)

```

- Moreover, it’s possible to use your own decryption and pass it to Compose `DocumentView`.

## Nesting DocumentView

**Q: Can I make `DocumentView` work as part of a larger Compose UI, taking up just a portion of the screen?**

**A:** Yes! Consider the following code:

```kotlin

Column {
    DocumentView(
        documentState = documentState,
        modifier = Modifier.fillMaxWidth().weight(0.33F, true),
    )
    Box(
        modifier = Modifier.fillMaxWidth().weight(0.67F, true)
    ) {
        // The remaining 2/3 of your mystical UI.
    }
}

```

## Conclusion

Nutrient offers many more customization options and features. We’re always aiming to expand these examples to the best of our capabilities. For comprehensive information about implementing and customizing Nutrient in your Android app, refer to our extensive [documentation](https://www.nutrient.io/guides/android.md), or [contact our Support team](https://support.nutrient.io/hc/en-us/requests/new) for personalized assistance.
---

## Related pages

- [Allow Clear Text Traffic](/guides/android/knowledge-base/allow-clear-text-traffic.md)
- [Disabling Annotation Rotation](/guides/android/knowledge-base/disabling-annotation-rotation.md)
- [Custom Print Functionality](/guides/android/knowledge-base/custom-print-functionality.md)
- [Deleting Pages From A Pdf](/guides/android/knowledge-base/deleting-pages-from-a-pdf.md)
- [Easily disable share and print options in Android](/guides/android/knowledge-base/disable-share-documentinfo-print.md)
- [Managing touch scrolling in Compose containers](/guides/android/knowledge-base/document-view-inside-pager-scroll-handling.md)
- [Getting All Digital Signatures](/guides/android/knowledge-base/getting-all-digital-signatures.md)
- [Change page layout dynamically based on orientation](/guides/android/knowledge-base/dynamic-page-layout-when-changing-orientation.md)
- [Getting Signature Location](/guides/android/knowledge-base/getting-signature-location.md)
- [Invoke Search Programmatically](/guides/android/knowledge-base/invoke-search-programmatically.md)
- [Install Failed Insufficient Storage](/guides/android/knowledge-base/install-failed-insufficient-storage.md)
- [Intercepting Touch Events](/guides/android/knowledge-base/intercepting-touch-events.md)
- [Creating invisible digital signatures in Android](/guides/android/knowledge-base/invisible-signature.md)
- [Invoking Share Action Programmatically](/guides/android/knowledge-base/invoking-share-action-programmatically.md)
- [Making Form Elements Read Only](/guides/android/knowledge-base/making-form-elements-read-only.md)
- [Override Hyperlink Behavior](/guides/android/knowledge-base/override-hyperlink-behavior.md)
- [Runtime Permissions Cordova](/guides/android/knowledge-base/runtime-permissions-cordova.md)
- [Remove Tool Variant From Toolbar](/guides/android/knowledge-base/remove-tool-variant-from-toolbar.md)
- [Customize the overflow button color in Android](/guides/android/knowledge-base/styling-overflow-button.md)
- [Save signed PDFs directly to a remote server on Android](/guides/android/knowledge-base/save-signed-pdfs-to-remote-server.md)
- [Using Pspdfkit With Dynamic Feature Modules](/guides/android/knowledge-base/using-pspdfkit-with-dynamic-feature-modules.md)

