Scan a document to PDF

Photograph the page, drag the four corners onto the paper, pick a look, and export a PDF. The app that normally does this stamps a watermark on the free export; this one has nothing to stamp.

How Document Scanner works

The file is read with a FileReader, rewritten in memory and offered as a download. This is why large PDFs are limited by your device's RAM rather than by an upload size limit. A 200 MB scan never crosses the network, so the slowest part is your own disk.

That is the whole architecture: static files, one script, no upload endpoint to leak or log. Close the tab and the work is gone.

What the four corners actually do

A photograph of a page is a projection: the rectangle of paper has been mapped onto a quadrilateral by the camera's lens. Recovering the rectangle means solving for that mapping. With four known point pairs — the four corners of the paper and the four corners of the output image — the transform is an eight-parameter projective matrix, and eight equations are exactly enough to pin it down.

The tool solves that system once per page, then walks every output pixel, sends it back through the inverse transform to find where it came from in the photograph, and samples the four neighbouring source pixels bilinearly. That is why a page photographed at an angle comes out rectangular rather than merely rotated, and why straight lines in the paper stay straight.

Why you place the corners yourself

Automatic edge detection is the feature every scanner app advertises and the one that fails most often — a page on a dark desk, a page with a white border, a page photographed under a lamp. When it fails you get a crooked crop and no way to argue with it.

Four draggable handles are a correction, not a guess. The Suggest the paper edge button still runs a cheap detector: it downsamples the photo, takes the gradient magnitude, builds projection profiles along both axes and picks the strongest edge in each half. On a plain desk that lands on the paper almost every time; on a busy background it says so instead of producing a bad crop.

What the black-and-white mode really is

The document preset converts each pixel to luminance, then computes an Otsu threshold — the cut-off that maximises the variance between the ink and the paper populations. Pixels above it become white, the rest become black. On a page of text photographed under uneven light this produces a cleaner result than any fixed threshold, because the cut-off is derived from the image itself.

Greyscale keeps the tones and only drops the colour, which is the right choice for photographs of receipts, stamps or anything where a hard threshold would eat detail. The colour option does nothing at all — it exists for pages with a signature in blue ink.

Pages, orientation and the output file

Each straightened page is added to a list. The PDF is written by pdf-lib with A4 pages (595.28 × 841.89 points), and each scan is fitted inside the page while preserving its aspect ratio, so a landscape page on a portrait sheet is centred rather than stretched. A page taller than it is wide gets a portrait sheet and vice versa.

Nothing is uploaded, and there is no watermark, no page ceiling and no daily quota. The comparison that matters: CamScanner's free tier stamps every export with its own mark and charges around $49.99 a year to remove it. Here the export is the export.

Good to know

  • Works offline once loaded, including on flights and in locked-down networks.
  • No file size limit beyond your device's own memory.
  • Free to use, with no account and no usage counter.
  • Results are produced locally, so they are not logged or shared with anyone.

Questions

Why drag the corners instead of automatic detection?

Automatic edge detection guesses, and when it guesses wrong you cannot fix it. Four draggable corners are the correction, so the result is right the first time. The Suggest edge button fills them in for you when the paper sits on a plain desk.

Is there a watermark or an export limit?

No watermark, no page limit, no daily quota. CamScanner's free tier watermarks every export and charges about $49.99 a year to remove it; there is nothing to remove here.

Does the perspective correction really work?

Yes — it solves the eight-parameter projective transform for your four corners and resamples every pixel through it. A page photographed at an angle comes out rectangular, not skewed.

Are my documents uploaded?

No. The photo is decoded by your browser, warped on a canvas and written into a PDF by pdf-lib, all in the tab. There is no upload endpoint on this site to send it to.

Keep going

More files tools