endpoint
Rotate
POST /api/v1/rotate
Rotate pages in 90-degree increments. Supports blanket angle or per-page map.
credits: 1returns: application/pdf
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| file | multipart file | required | Source PDF. |
| angle | 0 | 90 | 180 | 270 | optional | Rotation for all targeted pages. |
| pages | range spec | optional | Pages to rotate (with `angle`). |
| rotations | JSON object | optional | Per-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.pdfJavaScript
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})