Scanning

How to Scan a Document to PDF With Just Your Phone

ยทUpdated ยท9 min read

A dedicated flatbed scanner used to be the only way to turn a paper document into a clean, rectangular digital file. A photo taken at an angle, under uneven light, with the desk visible around the edges, never quite looked the same. Modern browser-based scanning closes that gap, using your phone camera as the input and computer vision to do the rest.

Why a photo of a document is not good enough

Sending a camera roll photo instead of a scan causes real problems, which is why the distinction is worth caring about. The page arrives as a trapezoid rather than a rectangle, because you were not holding the camera perfectly flat. The desk, your hand, and whatever else was on the table come along with it. Lighting falls off across the page, so one side reads darker than the other.

There are practical consequences beyond looking unprofessional. Upload portals frequently reject photos for being the wrong aspect ratio or too large. OCR performs badly on a page that is skewed and unevenly lit, so the document will not be searchable. And a full-resolution phone photo of an A4 page is several megabytes, which turns a ten-page document into something no email will accept.

What actually makes a photo look like a scan

Two things separate a "photo of a document" from a "scan." First, edge detection: the tool analyzes the image, finds the four corners of the page against the background, and lets you fine-tune them if it does not guess perfectly. Second, perspective correction: once the corners are known, the image is mathematically warped so the page fills a perfect rectangle, which is the same correction a flatbed scanner gets for free by pressing the page flat against glass.

The warp is doing more work than it appears to. It is not a rotation or a crop. Each of the four corners is mapped to a corner of the output rectangle, and every pixel in between is redistributed to match. Text that was compressed at the far edge of the photo, because that part of the page was further from the lens, gets stretched back to its proper proportions. This is why a corrected capture reads evenly across the page rather than getting tighter toward one side.

CocoPDF Scanner runs both steps locally in your browser using WebAssembly computer-vision code. Nothing is uploaded to a server while you are capturing and adjusting. Your photos only leave your device once you tap "Convert to PDF" at the end.

That local processing is worth pausing on if you scan anything sensitive. Passports, bank statements, medical letters, and signed contracts are exactly the documents people scan, and they are exactly the ones you would rather not upload to a stranger's server to find out the edge detection guessed wrong. Here the detection and correction happen on your own device, and only the finished pages are sent for assembly into a PDF.

Choosing the right filter

After capture, you can apply one of three filters:

  • Color keeps the original colors. Best for documents where color carries information, such as diagrams, forms with colored stamps, and ID cards.
  • Grayscale removes color but keeps shading. A good middle ground for photos or documents with shaded illustrations.
  • Black and White gives a high-contrast, pure black-on-white result. This is what most people mean by "scanned document", it looks the cleanest for plain text, and it compresses to the smallest file size.

For a typical contract, receipt, or printed form, Black and White gives the crispest, most professional-looking result. Save Color for anything where the color itself matters.

The filter is also the biggest lever on file size, often by a wide margin. Black and White stores essentially one bit per pixel, so a page can be a fraction of the size of the same page in colour. If you are scanning twenty pages of text for an upload with a size cap, choosing the right filter at capture time saves more than compressing afterwards will.

One caution: Black and White decides for every pixel whether it is black or white, with nothing in between. On a clean printed page that is exactly what you want. On a page with a faint pencil note, a light highlighter mark, or a signature in thin blue ink, those details can drop out entirely. If anything on the page is faint and matters, use Grayscale.

Getting a clean capture

  • Place the document on a flat, contrasting surface, such as a dark desk under a white page, so edge detection has a clear boundary to find.
  • Use even lighting and avoid casting your own shadow over the page.
  • Hold the camera as close to directly overhead as possible. Steep angles ask perspective correction to do more work and can soften text near the edges.
  • If the auto-detected corners are slightly off, drag them into place manually before continuing. A few seconds here avoids a skewed result.
  • Flatten the page first. A folded letter or a page curling out of a binder defeats corner detection, because the edges are no longer straight lines.
  • Leave a margin of background visible around all four edges. Filling the frame edge to edge gives the detector nothing to find the boundary against.

Lighting causes more failed captures than anything else. Direct overhead light produces a glare spot on glossy paper, and a window on one side produces a gradient across the page. Indirect daylight is the easiest thing to work with. If you only have a desk lamp, aim it at a wall and use the bounced light rather than pointing it at the document.

Multi-page documents

You are not limited to one page per PDF. After saving a page, tap "Add page" to capture the next one. Pages appear in a review grid where you can reorder them, delete any that came out badly, or re-shoot a page before finishing. Once every page looks right, "Convert to PDF" merges them into a single document.

Common uses

  • Scanning receipts for an expense report instead of photographing a messy pile.
  • Digitizing a signed contract or ID for a form submission that requires a PDF.
  • Capturing handwritten notes or a whiteboard at the end of a meeting.
  • Turning a printed article or textbook page into a searchable-ready PDF. Pair it with the OCR tool afterward, and see the OCR guide for how it works.

What to do after scanning

A scan is an image, so the resulting PDF is not searchable and cannot be converted to Word until it has a text layer. Run OCR on anything you will need to search later, which in practice means almost any document you are filing rather than sending once. Do this before compressing, since OCR needs the image detail that compression removes.

After OCR, compress if the file needs to go by email. Scans compress better than any other kind of PDF, often by 70 to 90%, because the images start out at a far higher resolution than reading requires. The text layer added by OCR survives compression untouched, so you keep the searchability.

If a page came out sideways because you captured it in landscape, fix it with Rotate PDF rather than leaving it and rotating in the viewer each time, which does not change the file. And if you scanned a batch of separate documents in one session, Split PDF breaks them back into individual files.

When you still want a real scanner

Phone scanning has closed most of the gap, but not all of it. A sheet-fed scanner is still faster for a stack of fifty pages, since it handles them unattended while phone capture is one page at a time. Bound books are awkward either way, though a phone often does better than a flatbed because you are not flattening the spine. And documents needing exact colour reproduction, such as artwork or photographs, are better served by a scanner with a calibrated sensor than by a camera under whatever light is in the room.

For everything else, which is receipts, forms, contracts, letters, and notes, phone capture with proper edge detection and perspective correction produces a result nobody can distinguish from a flatbed scan.

To try it, open the Scan PDF tool on your phone or laptop, allow camera access, and capture your first page. No app, no signup, and no watermark on the result.

Try it yourself

Everything in this article is free to use on CocoPDF, with no account needed.

๐Ÿ“ธ PDF Scanner