> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chromiumly.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Rotate PDFs

> Rotate PDF pages with PDFEngines.rotate or the rotate option on merge, split, and converters.

## PDFEngines.rotate

Rotates pages of existing PDFs using Gotenberg’s [rotate route](https://gotenberg.dev/docs/8.x/manipulate-pdfs/rotate-pdfs):

```typescript theme={null}
import { PDFEngines } from "chromiumly";

const buffer = await PDFEngines.rotate({
  files: ["path/to/file.pdf"],
  angle: 90,
  pages: "1-3", // optional; omit for all pages
});
```

* **angle** — `90`, `180`, or `270` (degrees)
* **pages** — Page range string (e.g. `"1-3"`, `"5"`). Omit or leave empty to rotate all pages.

`downloadFrom`, `webhook`, `outputFilename`, and `trace` are also accepted — see [Request tracing](https://docs.chromiumly.dev/v6/advanced/request-tracing.md).

## Optional rotate on other APIs

The same PDF-engine post-processing is available without a separate request:

* **`PDFEngines.merge()`** / **`PDFEngines.split()`** — optional `rotate: { angle, pages? }`
* **Chromium converters** (`UrlConverter`, `HtmlConverter`, `MarkdownConverter`) — optional `rotate` on `convert()`
* **`LibreOffice.convert()`** — optional `rotate`

Gotenberg builds the PDF first, then rotates the selected pages (second pass via the configured PDF engine). See [Gotenberg configuration — PDF engines](https://gotenberg.dev/docs/8.x/configuration#pdf-engines).

See [Merge](https://docs.chromiumly.dev/v6/pdf-engines/merge.md), [Split](https://docs.chromiumly.dev/v6/pdf-engines/split.md), [Chromium options](https://docs.chromiumly.dev/v6/chromium/options.md), and [LibreOffice](https://docs.chromiumly.dev/v6/libreoffice.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.