# Rotation

**RadPdfViewer** control provides functionality for rotating the pages of the loaded document. You can programmatically rotate the document pages through the RadPdfViewer class or you can use the provided command descriptors.

The article focuses on the following topics:

* [Rotation Using Command Descriptors](https://www.telerik.com/products/wpf/documentation/controls/radpdfviewer/ui/rotation#rotation-using-command-descriptors)

* [Rotation Using RadPdfViewer](https://www.telerik.com/products/wpf/documentation/controls/radpdfviewer/ui/rotation#rotation-using-radpdfviewer)

![Rad Pdf Viewer Rotation](https://www.telerik.com/products/wpf/documentation/assets/bee0bd37aabda49500e52a7182f6ba40/radpdfviewer_rotation.png)

## Rotation Using Command Descriptors

Command descriptors are wrappers for the predefined set of commands of **RadPdfViewer** which allow for the respective command to be enabled/disabled based on the current document state. More information on the topic is available here.

The following command descriptors are available in the **CommandDescriptors** property of the **RadPdfViewer** class:

* *RotateClockwiseCommandDescriptor* – rotates the document pages in clockwise direction with step 90 degrees.

* *RotateCounterClockwiseCommandDescriptor* – rotates the document pages in counterclockwise direction with step 90 degrees.

Those command descriptors are wrappers for the RotateClockwiseCommand and RotateCounterClockwiseCommand.

Here is an example usage of those command descriptors:

```XAML
	        <telerik:RadButton Content="Clockwise" Command="{Binding ElementName=radPdfViewer, Path=CommandDescriptors.RotateClockwiseCommandDescriptor.Command}"/>
	        <telerik:RadButton Content="Counterclockwise" Command="{Binding ElementName=radPdfViewer, Path=CommandDescriptors.RotateCounterClockwiseCommandDescriptor.Command}" />
```

## Rotation Using RadPdfViewer

**RadPdfViewer** has a **SetRotationAngle()** method intended to rotate the pages of the loaded document at the specified angle relative to its initial position. The method takes a single argument of type **RotationAngle**.

**RotationAngle** is an enumeration that specifies the angle at which the document should be rotated. The possible values are Degrees0, Degrees90, Degrees180, Degrees270.

```C#
this.pdfViewer.SetRotationAngle(RotationAngle.Degrees180);
```

The current angle at which the pages are rotated can be retrieved using the read-only **RotationAngle** property of **RadPdfViewer**.

```C#
RotationAngle currentAngle = this.pdfViewer.RotationAngle;
```
