> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/android/viewer/viewer-overview.md).

# Document viewer hierarchy in Android

Discover the best way to integrate a document viewer with DocumentActivity, PdfViewCtrlTabHostFragment2, PdfViewCtrlTabFragment2, and PDFViewCtrl. Choose the right form for your customization needs an

The document viewer is provided in three different forms:

* `DocumentActivity` ([Activity](https://developer.android.com/reference/androidx/appcompat/app/AppCompatActivity.html))
* [`PdfViewCtrlTabHostFragment2`](https://sdk.apryse.com/api/android/javadoc/reference/com/pdftron/pdf/controls/PdfViewCtrlTabHostFragment2.html) and [`PdfViewCtrlTabFragment2`](https://sdk.apryse.com/api/android/javadoc/reference/com/pdftron/pdf/controls/PdfViewCtrlTabFragment2.html) ([Fragment](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment.html))
* [`PDFViewCtrl`](https://sdk.apryse.com/api/android/javadoc/reference/com/pdftron/pdf/PDFViewCtrl.html) ([ViewGroup](https://developer.android.com/reference/android/view/ViewGroup/))

![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-c2889591f24714bda542e4a40401bba2c95c3fd8%2Ff6feed7d5b17574a13955ada0e666c5c8b8346f8-1268x864.png?alt=media)

## DocumentActivity

This activity contains all features in `PdfViewCtrlTabHostFragment2`, `PdfViewCtrlTabFragment2` and `PDFViewCtrl`.

`DocumentActivity` is easy to integrate, however runtime customization is not possible. A typical use case for `DocumentActivity` is when you require minimal UI and behaviour customization. [Events](/android/viewer/events.md) are **not** available, however customization is possible through [configuration](/android/viewer/fragment-config.md).

Learn how to [show a document using an activity](/android/open-save-document/open.md).

## PdfViewCtrlTabHostFragment2

This fragment contains all features in `PdfViewCtrlTabFragment2` and `PDFViewCtrl`.

`PdfViewCtrlTabHostFragment2` gives you full control over UI and behaviour customization. [Configuration](/android/viewer/fragment-config.md) and [events](/android/viewer/events.md) are both available. This is the **recommended** way to integrate the document viewer.

Learn how to [show a document using a fragment](/android/open-save-document/open/fragment.md) .

## PdfViewCtrlTabFragment2

This fragment contains all features in `PDFViewCtrl`.

`PdfViewCtrlTabFragment2` is used by each tab in `PdfViewCtrlTabHostFragment2`. This Fragment's layout consists of an `AnnotationToolbar` and a `PDFViewCtrl`. For a single-tab document viewer, it's possible to use this fragment by itself however you will miss out on UI components such as the view mode settings dialog and thumbnail viewer. A better approach would be to disable tabs in `PdfViewCtrlTabHostFragment2`.

## PDFViewCtrl

This ViewGroup is the core component for interactive document viewing.

`PDFViewCtrl` does not come with any toolbars or UI controls. A typical use case for `PDFViewCtrl` is when you need very fine control over the individual component and your requirements are very different than what `PdfViewCtrlTabHostFragment2` offers.

Learn how to [show a document using a ViewGroup](/android/open-save-document/open/view.md).

If you have any questions about these document viewer options, please feel free to contact the [Apryse support team](https://apryse.com/support).

## Learn more

* [Interactive annotation tools](/android/annotation/tools.md): The key component of the document viewer responsible for interactively creating/modifying/deleting annotations, filling forms, signing, selecting text, following links, and playing multimedia etc. It is managed by a [ToolManager](https://sdk.apryse.com/api/android/javadoc/reference/com/pdftron/pdf/tools/ToolManager.html) class. To customize `ToolManager` behaviour, see the [ToolManager configuration guide](/android/annotation/toolmanager-config.md).
* [Interactive UI components](/android/ui-customization/components-overview.md): The key component of the document viewer responsible for other interactive features such as reflow, document outline, list of annotations, page manipulation, and page cropping etc.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/android/viewer/viewer-overview.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
