# PagesApi.getRotation()

```ts
getRotation(pageIndex: number): Promise<PageOrientation>
```

The page's rotation as the file holds it: `0`, `90`, `180` or `270`.

- Kind: method
- Since: 1.0.0

| Parameter | Type | Description |
| --- | --- | --- |
| `pageIndex` | `number` | Zero-based page index. |

Returns `Promise<PageOrientation>`: `0`, `90`, `180` or `270`.

Throws:

- `INVALID_ARGUMENT` — a page index out of range.
- `DOCUMENT_CLOSED` — the document has been closed.

```ts
const upright = (await doc.pages.getRotation(0)) === 0;
```

Part of [PagesApi](https://kernstra.com/docs/web-sdk/api/doc-pages) in the Kernstra Web SDK 1.0.0 API reference.

Web page: https://kernstra.com/docs/web-sdk/api/doc-pages/getrotation
