Skip to main content

PDFEngines.rotate

Rotates pages of existing PDFs using Gotenberg’s rotate route:
import { PDFEngines } from "chromiumly";

const buffer = await PDFEngines.rotate({
  files: ["path/to/file.pdf"],
  angle: 90,
  pages: "1-3", // optional; omit for all pages
});
  • angle90, 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. See Merge, Split, Chromium options, and LibreOffice.