Document ScanningAPI IntegrationBest Practices

Scan to PDF API: Turn a Phone Photo into a Clean, Processable PDF

Martin Stämmler
Martin Stämmler
Founder, ScanKit.io
September 1, 20266 min read
Scan to PDF API: Turn a Phone Photo into a Clean, Processable PDF

A customer photographs a delivery note on a loading dock. An employee snaps a receipt under a desk lamp. A new hire uploads a photo of their ID during onboarding.

In all three cases the document arrives as a photo: skewed, shadowed, curved, and useless to the systems that need its content.

A scan-to-PDF API is the step that turns that photo into a clean, flat, text-ready PDF before anything downstream has to read it.

The problem with raw photos

Document photos fail in predictable ways:

  • Perspective: shot from an angle, so edges converge instead of running parallel
  • Skew: rotated a few degrees, so text lines drift downhill
  • Curvature: thick documents or bound pages bend in the middle
  • Lighting: shadows and glare wash out text near the edges

PDFs made directly from such photos carry all these defects into every downstream step. OCR quality drops, automated extraction returns garbage, and a human has to re-check each file.

What a scan-to-PDF API does

A scan-to-PDF API takes the photo and returns a PDF that looks like it came out of a flatbed scanner:

Photo → scan API → clean PDF → OCR / extraction / storage

Concretely, the API:

  • Detects the document in the photo (even against a cluttered background)
  • Corrects perspective so the page is rectangular and upright
  • Removes shadows and glare so text is legible edge to edge
  • Flattens curvature from bound or folded documents
  • Returns a clean PDF (or JPG) ready for the next step

None of this is OCR. It happens before OCR, and it decides whether OCR works at all.

Using the API

The ScanKit API exposes this as a single endpoint: POST /scan/crop. Send a JPEG, PNG, or PDF, get a clean scan back.

curl -X POST https://api.scankit.io/scan/crop \
  -H "X-API-Key: sk_your_key" \
  -F "file=@delivery-note.jpg" \
  -F "return_pdf=true"

The response is the cleaned document. From here you can:

  • Hand it to your OCR or LLM extraction step
  • Store it as the canonical record
  • Send it to a customer, partner, or system that expects a real PDF

One request, one clean document. No SDK required, no browser UI to embed, no vendor lock-in: the API is plain HTTP, so it works from any language and any stack.

Why teams add this before OCR

Most OCR and extraction tools are excellent at reading clean input and brittle with anything else. If you have ever seen SMlTH & S0NS come out of a perfectly good OCR engine, the problem was not the engine.

The scan step is cheap, deterministic, and removes the single biggest source of extraction errors: bad document geometry. Adding it before OCR is the difference between an extraction pipeline that works in demos and one that works on real documents.

Where the document data goes

Document photos are sensitive, and in the EU the processing location is often a compliance question before it is a technical one. When you evaluate a scan-to-PDF API, ask:

  • Is the processing EU-hosted?
  • Is the upload encrypted in transit?
  • Is the document deleted after processing?

ScanKit is built around those three answers: EU hosting, TLS in transit, and deletion after processing. Only the clean scan leaves the request. That makes the scan step safe to place in front of OCR even for customer documents, contracts, and HR paperwork.


The takeaway: a phone photo is not a document yet. A scan-to-PDF API makes it one in a single HTTP call, and everything downstream, OCR, extraction, storage, gets input it can actually read.

Try it with 50 free credits, no credit card required: create a free ScanKit account.

Ready to get started with ScanKit?

Start building powerful document scanning features into your applications today.