docubend

Rotate PDF pages

Turn every page, or just the ones that came out sideways.

How it works

  1. Drop your PDF in.
  2. Turn the pages that need it.
  3. Download the corrected PDF.

What it does

Scanners and phone cameras produce sideways pages with great enthusiasm. Rotating them is a small fix that most software makes oddly difficult, usually by rotating the view rather than the document — so it looks right on your screen and arrives sideways at the other end.

Turning the document, not the view

A quarter turn here is written into the file. When you download it and send it on, it opens the right way up for whoever receives it, in whatever they open it with. That is the difference between fixing a document and fixing your own screen.

One page or all of them

Turn every page at once when a whole scan came in sideways, or turn individual pages when only some did — which is what happens when a document was fed through a scanner in two batches. Each page shows its current orientation, so you can see what you are about to get.

No re-rendering

Rotation changes a property of the page rather than redrawing it, so nothing is re-compressed and nothing loses quality no matter how many times you turn it. A page rotated four times is byte-for-byte the document you started with.

Doing this from your own code

Page order and orientation live in the model's pages array. Fetch it, rearrange it, put it back.

curl
# fetch the model, change it, put the whole thing back
curl -s https://docubend.com/api/v1/documents/$ID.json \
  -H "Authorization: Bearer $TOKEN" -o model.json

# …edit model.json…

curl -s -X PUT https://docubend.com/api/v1/pdfs/$ID \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"model\": $(cat model.json)}"
JavaScript
const got = await fetch(`${BASE}/api/v1/documents/${id}.json`,
  { headers: { Authorization: `Bearer ${TOKEN}` } });
const model = await got.json();

// …change model.pages…

await fetch(`${BASE}/api/v1/pdfs/${id}`, {
  method: "PUT",
  headers: { Authorization: `Bearer ${TOKEN}`,
             "Content-Type": "application/json" },
  body: JSON.stringify({ model }),
});
Python
model = requests.get(f"{BASE}/api/v1/documents/{id}.json",
    headers={"Authorization": f"Bearer {TOKEN}"}, timeout=60).json()

# …change model["pages"]…

requests.put(f"{BASE}/api/v1/pdfs/{id}",
    headers={"Authorization": f"Bearer {TOKEN}"},
    json={"model": model}, timeout=60)

The model is the same JSON the editor works on. Documents reference.

Questions

Does rotating reduce quality?

No. It sets a property on the page; the content is not redrawn or re-compressed.

Can I rotate only some pages?

Yes. Turn them individually, or apply one turn to the whole document.

Will it stay rotated when I email it?

Yes. The rotation is written into the file rather than applied to your view of it.

Can I rotate by an angle other than 90 degrees?

No. PDF page rotation is defined in quarter turns, so those are the options anything can honestly offer.

Does the file leave my browser?

No. The page is opened and rewritten here.

Next

Tool What it does Runs in Same thing, programmatically
Reorder PDF pages Drag pages into the right order. your browser the document model
Delete pages from a PDF Remove the pages you do not want to send. your browser the document model
Split a PDF Pull out the pages you want, or make one file per page. your browser GET /api/v1/documents/{id}.pdf
Convert PDF to JPG Get every page as a JPG or a PNG. your browser GET /api/v1/documents/{id}.png

All 16 tools · API documentation · What an account adds