Rotate PDF API
Still shipping PDFs where page 3 is sideways, page 7 is upside down, and the "fix" is a manual re-export? Rotate by 90, 180, or 270 degrees — and choose exact pages so you don't accidentally break a perfectly fine layout.
curl -X POST "https://api.xspdf.com/v1/pdf/rotate" \
-H "Authorization: Bearer $API_KEY" \
-F "file=@report.pdf" \
-F "rotation=90" \
-F "pages=3,7-9" \
-o "report.fixed.pdf" Rotation accepts: 90, 180, 270. Pages accepts: all, a list (3,7,9), or ranges (7-9).
You know the feeling when the PDF is "almost right"…
Page 1 looks perfect. Page 2 is fine. Then suddenly page 3 is rotated sideways — and now your users are pinching, zooming, and rage-scrolling. Worse: you "fix" it by rotating the entire document and accidentally ruin pages that were already correct.
Layout breaks = support tickets
"Why is this page sideways?" is a surprisingly expensive question to answer at scale.
Manual fixes don't stick
One new upload, one re-scan, one vendor update… and the rotation bug returns.
Rotation should be deterministic
"It depends on the viewer" is not a product strategy. Your pipeline should output consistently oriented pages.
If this pain starts with a scanner, you're not imagining it: scanned batches often mix orientations inside a single file. That's why page-level rotation matters. For deeper tactics, read our guide on Scanned Documents.
There's a better way: rotate only what's wrong
The Rotate PDF API is built for one job: fix orientation without collateral damage. Choose a rotation angle (90 / 180 / 270) and apply it to the whole document or just specific pages. That means your "good" pages stay untouched — links, layouts, and pagination remain predictable.
Use explicit angles: 90 (clockwise), 180 (upside down), 270 (counter-clockwise). No guessing.
Apply rotation to all pages or only the pages you specify (lists + ranges).
Stop relying on client-side viewing quirks. Normalize orientation server-side once.
curl -X POST "https://api.xspdf.com/v1/pdf/rotate" \
-H "Authorization: Bearer $API_KEY" \
-F "file=@contract.pdf" \
-F "rotation=180" \
-F "pages=all" \
-o "contract.rotated.pdf" curl -X POST "https://api.xspdf.com/v1/pdf/rotate" \
-H "Authorization: Bearer $API_KEY" \
-F "file=@batch.pdf" \
-F "rotation=270" \
-F "pages=2,6,10-12" \
-o "batch.fixed.pdf" Tip: if you're rotating scanned pages, consider validating orientation early in your ingest pipeline. Our Scanned Documents guide shows what typically goes wrong (and how to prevent repeat fixes).
Rotating only the pages that need it keeps the rest of the document stable—so your QA isn't re-checking every page after every "tiny fix."
What you get (besides correctly oriented pages)
This isn't "rotate a PDF" as a checkbox feature. It's a layout-stability tool: fewer manual interventions, fewer re-uploads, fewer user complaints.
Fix page 3 and 7–9, keep page 1–2 pristine. No "one step forward, two steps back."
Normalize orientation server-side so mobile viewers, web embeds, and printers agree.
Stop emailing "final_v7_ROTATED.pdf". Fix orientation programmatically in your workflow.
Only valid rotations (90/180/270) + clear page targeting means fewer integration bugs.
The output is a PDF you can trust in downstream steps—merge, sign, extract, or archive.
From a single sideways invoice to large batches of mixed-orientation scans.
FAQ: Rotate PDF API (the questions people ask right before they integrate)
These are the "wait—what about…" details that decide whether rotation becomes a clean automation or a recurring manual chore.
What rotation values are supported (90, 180, 270)?
Can I rotate only certain pages instead of the whole document?
Is this the same as a "change PDF orientation API"?
Will rotating pages affect links, layout, or text extraction?
Ready to fix orientation issues programmatically?
Start rotating PDFs with precision — no manual re-exports required.