> 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/page-manipulation/rotate-pages.md).

# Rotate pages

Rotate PDF Pages in Android and iOS with Apryse SDK. Learn how to rotate pages within a document using UI components or programmatically. Enhance your PDF viewing experience now! The Apryse Xamarin SD

Apryse SDK allows you to rotate pages within a document.

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

## Rotating PDF pages in Android

You can rotate pages in a document using the UI component or programmatically with the Xamarin.Android API.

[UI Component](/xamarin/guides/android/manipulation/rotate-pages.md#ui-component) The rotate pages dialog allows you to rotate pages with a graphical interface in the document viewer.

[API guide](/xamarin/guides/android/manipulation/rotate-pages.md#api-guide) You can programmatically rotate pages in documents.
{% endtab %}

{% tab title="iOS" %}

## Rotating PDF pages in iOS

To rotate a page in a PDF document.

{% code lineNumbers="true" %}

```csharp
PDFDoc doc = new PDFDoc(filename);

// Rotate the first page 90 degrees clockwise.
Page page = doc.GetPage(1);
Page.Rotate originalRotation = page.GetRotation();
Page.Rotate rotation;
switch (originalRotation)
{
  case Page.Rotate.e_0:   rotation = Page.Rotate.e_90;  break;
  case Page.Rotate.e_90:  rotation = Page.Rotate.e_180; break;
  case Page.Rotate.e_180: rotation = Page.Rotate.e_270; break;
  case Page.Rotate.e_270: rotation = Page.Rotate.e_0;   break;
  default:                rotation = Page.Rotate.e_0;   break;
}
page.SetRotation(rotation);
```

{% endcode %}

## About rotating pages

A page can be rotated clockwise, by 90 degrees, when displayed or printed. The `Page.GetRotation()` method returns the `Page.Rotate` enum specifying the current rotation. Similarly, `Page.SetRotation()` sets the current rotation.
{% 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/page-manipulation/rotate-pages.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.
