> 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/outline-i.md).

# Display outlines & bookmarks in Xamarin

Learn how to implement a document outline in Xamarin.iOS using PTOutlineViewController class. Navigate through PDF documents with ease and enhance user experience. Add the Tools library to your projec

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

A document outline, or table of contents, demonstrates how the PDF document is organized and helps users see the overall picture. The [`PTOutlineViewController`](https://sdk.apryse.com/api/xamarinios/tools/api/pdftron.PDF.Controls.PTOutlineViewController.html) class shows the document outline (table of contents) that can be used to navigate through the document being viewed by a [`PTPDFViewCtrl`](https://sdk.apryse.com/api/xamarinios/tools/api/pdftron.PDF.PDFViewCtrl.html) by tapping on a bookmark item.

![](https://653871032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgjsBtuYmcKhWOdM9VCg4%2Fuploads%2Fgit-blob-9acb375f71cdbf76d2250227df451bef01effd66%2Fa400d02a39898855332fc3a1d2b17effe42eb9a7-1242x2208.png?alt=media)

*The outline control is part of the Tools library, so make sure you have* [*added the Tools library to your project*](/xamarin/ui-customization/setup.md)*.*

## Show an outline view controller

To create a new outline view controller instance and display it from another view controller, supply a `PTPDFViewCtrl` instance to the `PTOutlineViewController` designated initializer:

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

```csharp
var outlineViewController = new pdftron.PDF.Controls.PTOutlineViewController (mPdfViewCtrl);
outlineViewController.OutlineViewControllerOutlineSelected += (sender, e) => {
  // perform custom action
    this.DismissViewController (true, null);
};
outlineViewController.OutlineViewControllerDidCancel += (object sender, EventArgs e) => {
  this.DismissViewController (true, null);
};

var navigationController = new UINavigationController (outlineViewController);

if (UserInterfaceIdiomIsPad)
{
    navigationController.ModalPresentationStyle = UIModalPresentationStyle.Popover;
    navigationController.PopoverPresentationController.BarButtonItem = outlineButton;
}

this.PresentViewController (navigationController, true, null);
```

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

{% hint style="info" %}
**The outline view controller must be pushed onto a navigation controller's stack before being shown.**
{% endhint %}

{% hint style="info" %}
**Presenting on iPads:**

The outline view controller is designed to be presented in a popover on iPads. To do so, you must provide the `PTOutlineViewController`'s [`PopoverPresentationController`](https://docs.microsoft.com/en-us/dotnet/api/uikit.uipopoverpresentationcontroller) with either:

* a [`SourceRect`](https://docs.microsoft.com/en-us/dotnet/api/uikit.uipopoverpresentationcontroller.sourcerect#UIKit_UIPopoverPresentationController_SourceRect) AND
* a [`SourceView`](https://docs.microsoft.com/en-us/dotnet/api/uikit.uipopoverpresentationcontroller.sourceview#UIKit_UIPopoverPresentationController_SourceView)

OR

* a [`BarButtonItem`](https://docs.microsoft.com/en-us/dotnet/api/uikit.uipopoverpresentationcontroller.barbuttonitem#UIKit_UIPopoverPresentationController_BarButtonItem)

as in the example above.
{% endhint %}

You can set a delegate to be notified by the outline view controller when outline bookmarks are selected with the `PTOutlineViewControllerDelegate` protocol. (See the CompleteReader example for usage of an `PTOutlineViewController`.)


---

# 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/outline-i.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.
