> 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/viewer/custom-viewer.md).

# Customize PDFViewCtrl

Learn how to customize PDF viewing experience in Xamarin.Android with Apryse SDK. Control page colors, layout, scrolling, and more. Enhance user experience now! The Apryse Xamarin SDK streamlines secu

Apryse SDK uses a viewing UI component developed in-house that you can customize.

{% tabs %}
{% tab title="Android" %}

## Customizing PDF view in Xamarin.Android viewer

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

The [PDFViewCtrl](https://sdk.apryse.com/api/xamarinandroid/pdfnet/api/pdftron.PDF.PDFViewCtrl.html) has a large API set that can be used to control how the PDF is presented to the user. This guide highlights some of the most commonly used functionality.

If you are using a `DocumentActivity` (or `PdfViewCtrlTabHostFragment2`), the contained PDFViewCtrl can be customized through [PDFViewCtrlConfig](/xamarin/viewer/viewer-config.md#android).

## Customize the viewing experience

* [Custom page colors](/xamarin/guides/android/viewer/themes.md#custom) including day mode, night mode, or custom color mode
* [Automatic and dynamic page fit/zoom control](/xamarin/guides/android/viewer/view-mode.md) using fit page, fit width, fit height, or zoom
* [Page layout mode](/xamarin/guides/android/viewer/view-mode.md) and [scrolling direction](/xamarin/viewer/scroll-direction.md) (i.e. vertical scrolling or continuous view mode)
* [Right-to-left (RTL) reading mode](/xamarin/viewer/rtl-support.md)
* [Adding custom views to PDFViewCtrl](/xamarin/ui-customization/custom-view.md#android)

## Properties and methods

| API                        | Description                                                                                                                                                               |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `SetPagePresentationMode`  | Set how pages are presented and scrolled: in 1 or 2 columns, scrolled vertically or horizontally                                                                          |
| `SetPageViewMode`          | Sets the zoom level relative to the page size, fit-width, fit-height or fit-page.                                                                                         |
| `SetPageRefViewMode`       | When a document is scrolled via horizontal swipes, use this method to control what zoom level new pages are rendered at.                                                  |
| `SetClientBackgroundColor` | Sets the color that is seen around pages.                                                                                                                                 |
| `SetupThumbnails`          | Controls how low-resolution thumbnails are handled. Enlarged thumbnails are used in place of high-resolution content while the high-resolution content is being rendered. |
| `SetProgressiveRendering`  | Controls how frequently the high-resolution content is updated while it is being rendered.                                                                                |
| `SetDrawAnnotations`       | Controls if annotations are visible.                                                                                                                                      |
| `SetHighlightFields`       | Controls if form fields are shaded with light blue.                                                                                                                       |
| `SetOverprint`             | Controls how PDFs that use overprint colors are rendered.                                                                                                                 |
| `SetColorPostProcessMode`  | Can be used to turn on night-mode and other color processing changes.                                                                                                     |
| {% endtab %}               |                                                                                                                                                                           |

{% tab title="iOS" %}

## Customizing PDF view in Xamarin.iOS viewer

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

The [`PDFViewCtrl`](https://sdk.apryse.com/api/xamarinandroid/pdfnet/api/pdftron.PDF.PDFViewCtrl.html) is the view that displays the PDF - it does not include any toolbars, buttons or UI beyond presenting the PDF. It has a large API that can be used to control how the PDF is presented to the user. All of the APIs that you can use are well documented. This guide highlights some of the most commonly used functionality.

If you are using a `PTDocumentController` (or `PTTabbedDocumentViewController`), the contained `PTPDFViewCtrl` can be accessed as a property:

{% code lineNumbers="true" %}

```csharp
var documentController = new pdftron.PDF.Controls.PTDocumentController();

documentController.pdfViewCtrl
```

{% endcode %}

### Properties and methods

| API                       | Description                                                                                                                                                               |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `SetPagePresentationMode` | Set how pages are presented and scrolled: in 1 or 2 columns, scrolled vertically or horizontally                                                                          |
| `SetPageViewMode`         | Sets the zoom level relative to the page size, fit-width, fit-height or fit-page.                                                                                         |
| `SetPageRefViewMode`      | When a document is scrolled via horizontal swipes, use this method to control what zoom level new pages are rendered at.                                                  |
| `SetBackgroundColor`      | Sets the color that is seen around pages.                                                                                                                                 |
| `SetupThumbnails`         | Controls how low-resolution thumbnails are handled. Enlarged thumbnails are used in place of high-resolution content while the high-resolution content is being rendered. |
| `overlayView`             | This view is used for drawing system-content over the PDF.                                                                                                                |
| `SetProgressiveRendering` | Controls how frequently the high-resolution content is updated while it is being rendered.                                                                                |
| `SetDrawAnnotations`      | Controls if annotations are visible.                                                                                                                                      |
| `SetHighlightFields`      | Controls if form fields are shaded with light blue.                                                                                                                       |
| `SetOverprint`            | Controls how PDFs that use overprint colors are rendered.                                                                                                                 |
| `SetColorPostProcessMode` | Can be used to turn on night-mode and other color processing changes.                                                                                                     |

### Delegate callbacks

The [`PDFViewCtrl`](https://sdk.apryse.com/api/xamarinandroid/pdfnet/api/pdftron.PDF.PDFViewCtrl.html) includes two delegates (`delegate` and `toolDelegate` to relay touch and other events that occur on the control.

The first is a general purpose delegate, the second was designed specifically for enabling the [`Tools.framework`](/xamarin/annotation/tools-overview.md#ios) functionality via its conforming object [`PTToolManager`](https://sdk.apryse.com/api/xamarinios/tools/api/pdftron.PDF.Tools.PTToolManager.html). If you are using the tools framework, a `PTToolManager` should always be assigned as the `PTPDFViewCtrl`'s `toolDelegate` object. If you are not using the `Tools.framework`, it may be used for whatever purpose your app requires.

{% hint style="warning" %}
**Delegates when using a PTDocumentController**

When using a `PTDocumentController` (or `PTTabbedDocumentViewController`), the `PTPDFViewCtrl` delegates are used internally and **cannot be reassigned** to another object. To receive the delegate callbacks, create a subclass of `PTDocumentController` and implement the required methods, being sure to call `super`.
{% endhint %}
{% 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 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/xamarin/viewer/custom-viewer.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.
