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

## 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/configuration#pdf-engines).

See [Merge](/pdf-engines/merge), [Split](/pdf-engines/split), [Chromium options](/chromium/options), and [LibreOffice](/libreoffice).
