SnapPDF
endpoint

Rotate

POST /api/v1/rotate

Rotate pages in 90-degree increments. Supports blanket angle or per-page map.

credits: 1returns: application/pdf

Parameters

NameTypeRequiredDescription
filemultipart filerequiredSource PDF.
angle0 | 90 | 180 | 270optionalRotation for all targeted pages.
pagesrange specoptionalPages to rotate (with `angle`).
rotationsJSON objectoptionalPer-page map — { "1": 90, "3": 270 }.

Examples

curl
curl -X POST https://api.snappdf.au/api/v1/rotate \
  -H "Authorization: Bearer $SNAPPDF_API_KEY" \
  -F "file=@doc.pdf" -F "angle=90" \
  -o rotated.pdf
JavaScript
await snap.pdf.rotate({ file: bytes, angle: 90 });
Python
snap.pdf.rotate(file=bytes, angle=90)
PHP
$snap->pdf->rotate(file: $bytes, angle: 90);
Ruby
snap.pdf.rotate(file: bytes, angle: 90)
Go
client.Rotate(ctx, &snappdf.RotateInput{File: bytes, Angle: 90})