ForHosting KIT · Documents & PDF

Rotate a PDF

Scanners feed pages in landscape, phones photograph documents in any orientation, and the PDF that lands on your desk ends up needing its neck cranked to read. This endpoint straightens it out programmatically — pick an angle, pick which pages, done.

● StablePer request + per page$0.002
Use it from WebAPIEmailApp soonTelegram soon

Run this on our servers with your account. Free tools run in your browser; this one bills your KIT balance per the price above.

The sideways-page problem is more common than it should be

Anyone who has scanned a stack of mixed-orientation paperwork knows the result: half the pages read fine, half need your head tilted 90 degrees. Multi-function scanners, fax-to-PDF gateways and mobile capture apps all produce this inconsistently, and manually fixing it page by page in a desktop PDF viewer does not scale past a handful of documents. This endpoint exists specifically for that cleanup step, done in bulk, without a human touching a mouse.

What rotation actually changes

Rotating a PDF page sets its display orientation — the content itself is untouched, but the page renders turned by the angle you specify: 90, 180 or 270 degrees, clockwise. That distinction matters because it means the operation is lossless and instant relative to re-scanning: no re-OCR, no quality loss, no re-typesetting. You can rotate the whole document uniformly, or target specific pages when only some of them came in sideways.

How the call works

POST the PDF and the rotation angle (plus optional page selection) to /pdf/rotate. Like every task in this API, it runs asynchronously: you receive a task_id right away and the corrected file arrives via your signed webhook, or through a signed link that stays live for 24 hours if you'd rather fetch it on your own schedule.

Where it belongs in a workflow

This is almost never used alone — it's the quiet second step after a scan-to-PDF or fax-to-PDF pipeline, run automatically before the document is filed, OCR'd or emailed onward. Chaining it with a scanned-vs-native check first lets you rotate only what actually needs it, instead of blindly rotating every incoming file.

What it costs and doesn't cost you

It's a flat $0.002 per request regardless of page count, because rotation is a lightweight structural change rather than a rendering-heavy one. If the task fails after its automatic retries, you're not charged — the pricing reflects the actual work done, not a guess.

Cleaning up scanner batches

A back-office scanner drops mixed-orientation pages into a folder; a watcher job rotates every sideways page to 0 degrees before archiving.

Fax-to-email intake

Inbound faxes convert to PDF upside down about half the time; this endpoint corrects orientation automatically before routing to the right inbox.

Mobile document capture

A field app lets staff photograph paperwork with a phone; server-side rotation fixes whatever orientation the camera happened to save.

Pre-processing before OCR

OCR accuracy drops sharply on rotated text; running rotation first ensures the recognition step gets upright pages.

How do I rotate a PDF with the API?

Send a POST request to /pdf/rotate with the file and the desired angle — 90, 180 or 270 degrees — and you'll get the corrected PDF back via webhook or signed link.

Can I rotate only some pages, not the whole document?

Yes, you can target specific pages by number while leaving the rest of the document at its original orientation.

Does rotation reduce quality or re-run OCR?

No. It only changes the page's display orientation metadata; the underlying content, resolution and any existing text layer stay exactly as they were.

Is there a free way to try the rotate PDF API?

There's no free tier — free tiers get abused and slow everyone down. Access runs on a prepaid ForHosting KIT balance: top up from $10.00 (it never expires) and each request is charged at its published price, so a call with no balance returns HTTP 402. No subscription, no tokens, no invented credits, and a failed task is never charged.

Can I rotate counter-clockwise?

Specify 270 degrees for a counter-clockwise quarter-turn, or 90 for clockwise; both are handled as standard angle values.

What if the PDF is already right-side up?

You can simply skip the call, or pair this endpoint with an orientation check beforehand so you only rotate files that actually need it.

How fast does rotation run in bulk?

Because it's a lightweight structural operation rather than a rendering job, it processes quickly even across large batches submitted as separate tasks.

What happens if a rotation task fails?

It retries automatically up to three times; if it still can't complete, you receive a clear error and are never billed for the failed attempt.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/pdf/rotate

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, and soon from our app, email and Telegram.

curl -X POST https://api.kit.forhosting.com/pdf/rotate \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"pdf":"https://ejemplo.com/documento.pdf"}'
{
  "pdf": "https://ejemplo.com/documento.pdf"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "pdf.rotate",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_mb25
max_pages200
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.
413input_too_largeThe file exceeds the size limit.

Read the full KIT documentation →