Skip to main content
All posts
edit scanning PDF API

Fixing a Sideways Scan, and Stamping It Correctly

Rotate every page of a scanned document in one change, and get page numbers and stamps that land the right way up on every page whichever way it was fed through the scanner.

PodPDF Team September 16, 2026 4 min read

Someone fed the bundle through the scanner the wrong way. Two hundred pages, all on their side, and the person who has to read it is tilting their head.

That part is easy to fix. The part that catches people out is what happens next, when you try to number or stamp the thing.

Turning the whole document

In the editor, add a rotation, choose All pages, save. One change, one operation, whatever the page count.

Through the API, leave pages out:

curl -X POST https://api.podpdf.com/pdf/edit \
  -H "X-API-Key: $PODPDF_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
        "source_key": "pdf-uploads/…",
        "recipe": [{ "op": "pages.rotate", "degrees": 90 }]
      }'

degrees goes in steps of 90. By default it sets the rotation, so every page ends up the same way regardless of how it started — which is usually what you want for a scan that came out consistently wrong. Add "relative": true to turn each page from wherever it currently is instead, for a document that is wrong in more than one direction.

Nothing is re-rendered. Rotation is a property of the page, so turning a 200-page scan is instant and the images are untouched — no recompression, no quality loss.

The bit that goes wrong elsewhere

Here is the trap. A scanned page is often stored in one orientation with a flag telling the viewer to turn it. The page’s own coordinates and what the reader sees are not the same thing.

Ask most tools for a stamp in the bottom-right of such a page and you get the bottom-right of the stored page — which the reader sees somewhere else entirely, lying on its side. In a bundle of two hundred pages where only some were scanned sideways, a handful come out wrong and nobody notices until the other side does.

PodPDF places marks in the corner the reader sees, the right way up, whatever rotation the page carries. Bates numbers, headers, footers and watermarks all work this way. A bundle of mixed portrait letters and landscape exhibits comes out consistent, and you do not have to sort the scans first or check them afterwards.

You can see it before saving: preflight reports where each mark lands, and the editor draws it on the page as you work.

Doing both at once

Rotating and numbering in the same save is fine, and the order is handled:

"recipe": [
  { "op": "pages.rotate", "degrees": 90 },
  { "op": "pages.delete", "pages": ["p7"] },
  { "op": "bates.stamp", "prefix": "ACME-", "start": 1, "digits": 6 }
]

The editor applies marks first, then structural changes, then numbering — so the numbering sees the document as it will actually be. Remove a page and the sequence stays contiguous rather than skipping a number. Through the API, operations apply in the order you write them, so put deletions before anything that numbers.

When rotation is not the answer

Rotation fixes a page that was scanned at ninety degrees. It does not fix a page scanned at three degrees because the paper went in crooked — that is deskewing, which means re-rendering the image, and PodPDF does not do it. Nothing here re-renders anything, which is why it is fast and lossless, and also why a crooked scan stays crooked.

It also cannot help a page that is upside down in the image itself with no rotation flag, because as far as the file is concerned that is simply what the page looks like.

Limits

One document at a time, up to 200 pages and 150 MB — enough for a 200-page scanned bundle. Longer documents get split first, then edited in parts.

edit scanning PDF API
Back to blog

PodPDF is built by XAD Labs, which builds custom PDF processing pipelines at scale.

Start generating PDFs today

$0.005 per PDF on a monthly plan, or $0.01 from one-off credit packs.