> 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/xamarin/guides/viewer-components/thumbnails-view-a.md).

# Using thumbnail browser to manipulate PDFs in Xamarin

Learn how to manipulate pages in a document with ThumbnailsViewFragment in Xamarin.Android. Add, remove, rearrange, and export pages easily. Click to explore more! The Apryse Xamarin SDK streamlines s

{% hint style="info" %}
**This tutorial only applies to Xamarin.Android. See Xamarin.iOS equivalent here .**
{% endhint %}

The [`ThumbnailsViewFragment`](https://sdk.apryse.com/api/xamarinandroid/tools/api/pdftron.PDF.Controls.ThumbnailsViewFragment.html) class allows users to manipuate pages of a document including add, remove, re-arrange, rotate and duplicate pages. Users are also able to undo/redo page manipulations.

![](https://653871032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgjsBtuYmcKhWOdM9VCg4%2Fuploads%2Fgit-blob-b2be354b1079b2634036eb904006d82e81becb52%2Fb25f5232f4421874bfbbb81868578fbc4b041d7b-1080x2220.gif?alt=media)

## Show page thumbnails dialog

To show a page thumbnails dialog in your activity, create a new instance of [`ThumbnailsViewFragment`](https://sdk.apryse.com/api/xamarinandroid/tools/api/pdftron.PDF.Controls.ThumbnailsViewFragment.html) by calling `newInstance()` and setting the [`PDFViewCtrl`](https://sdk.apryse.com/api/xamarinandroid/pdfnet/api/pdftron.PDF.PDFViewCtrl.html):

{% tabs %}
{% tab title="C#" %}
{% code lineNumbers="true" %}

```csharp
var thumbDialog = ThumbnailsViewFragment.NewInstance();
thumbDialog.SetPdfViewCtrl(mPdfViewCtrl);
thumbDialog.SetStyle((int)DialogFragmentStyle.NoTitle, Resource.Style.PDFTronAppTheme);
thumbDialog.Show(this.SupportFragmentManager, "thumbnails_dialog");
```

{% endcode %}
{% endtab %}
{% endtabs %}

If you want to specify that the document is read-only you can use `newInstance(boolean)`:

{% tabs %}
{% tab title="C#" %}
{% code lineNumbers="true" %}

```csharp
var thumbDialog = ThumbnailsViewFragment.NewInstance(true);
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Export pages

If you would like to allow users to export a subset of pages from the document, you should implement `OnExportThumbnailsListener` interface by providing implementation for exporting pages:

{% tabs %}
{% tab title="C#" %}
{% code lineNumbers="true" %}

```csharp
thumbDialog.ExportThumbnails += (sender, e) =>
{
    // Implementation for exporting given pages.
};
```

{% endcode %}
{% endtab %}
{% endtabs %}

If you set `OnExportThumbnailsListener`, the "Export" menu item will show up in the overflow menu when at least one page is selected.

![](https://653871032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgjsBtuYmcKhWOdM9VCg4%2Fuploads%2Fgit-blob-d98f6371d28779827fe3922bfef59bcf0e10172f%2F27a1c3268ecd4bd3414fcac62d4851246337cfdb-1080x2160.png?alt=media)

## Dialog callbacks

If you want to be notified when the thumbnails view dialog fragment is dismissed, implement `OnThumbnailsViewDialogDismissListener` interface. Also, if you want to be notified when the user attempts to edit pages while the document is read only you should implement `OnThumbnailsEditAttemptWhileReadOnlyListener` interface:

{% tabs %}
{% tab title="C#" %}
{% code lineNumbers="true" %}

```csharp
thumbDialog.ThumbnailsViewDialogDismiss += (sender, e) =>
{
    // Handle viewer when the thumbnails view dialog is dismissed.
};
thumbDialog.ThumbnailsEditAttemptWhileReadOnly += (sender, e) =>
{
    // Show message when user attempts to edit pages of a read only document.
};
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.apryse.com/xamarin/guides/viewer-components/thumbnails-view-a.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
