What Scan to PDF Does

Scan to PDF turns a photo of a paper document, taken with your phone camera or already sitting in your photo library, into a flat, rectangular PDF page. Open /scan-to-pdf, upload or capture the image, and the tool automatically finds the four corners of the document against its background. You can drag any corner that landed in the wrong spot, then the tool warps the image so the page looks like it was scanned flat on a scanner bed rather than photographed at an angle. Add more pages the same way and download a single PDF when you're done. There's no software to install and no account to create. The whole process, from corner detection to the final warp, runs in your browser tab; the photo never leaves your device.

How Corner Detection Works

Corner detection uses a classical gradient scan rather than a machine-learning model. For each of the document's four sides, the tool samples nine scan lines running perpendicular to that side, moving inward from the photo's border. Each line looks for the steepest jump in brightness, the point where background gives way to paper. Rather than trusting the first line that finds an edge or averaging all nine, the tool takes the median offset across the nine results. That matters in practice: if one scan line happens to cross a shadow or a printed line on the document itself, it produces an outlier reading, and the median throws that outlier out instead of letting it drag the whole side off. When a side has no clear brightness jump at all, such as a white page photographed on a white desk, the tool falls back to a fixed inset of about 8% from that side's raw border rather than guessing at a location with no real signal.

Why Flattening Beats Cropping

A document photographed at an angle isn't just rotated, it's distorted: the far edge looks smaller than the near edge, and straight lines near the corners can look slightly bowed. Cropping to the corners you see would keep that distortion. Instead, once the four corners are set, the tool computes a proper four-point perspective transform (a homography) that maps those corners onto a true rectangle, then inverse-warps the image with bilinear sampling to fill in the result. That's what actually produces a flat-looking page: text lines come out straight and parallel, and the page reads like it was placed on a flatbed scanner instead of shot handheld. This step is also why dragging the corners to match the real document edges matters more than getting the photo itself perfectly square. Corner accuracy feeds directly into the warp, so a well-placed quad matters more than a perfectly aimed camera.

Why It Takes a Few Seconds on Phone Photos

A modern phone camera captures 12 megapixels or more, and warping an image that large, pixel by pixel, with bilinear sampling at each destination point, is real computation: on a full-resolution photo it can add up to 10 seconds or more of continuous work. Rather than run that as one blocking pass, which would freeze the tab and make the progress indicator stop updating, the tool processes the output in chunks of about 24 rows at a time and yields control back to the browser between chunks. The visible effect is a progress bar that actually moves and a tab that stays responsive while the warp finishes, rather than a page that appears to hang. If a scan feels like it's taking a moment on an older phone or a very large photo, that's the chunked warp doing real per-pixel work, not a stall.

Everything Happens in Your Browser

Scan to PDF runs entirely client-side. The photo you scan, whether it's a tax form, a signed contract, or a medical record, is processed using your browser's own canvas and image APIs and is never uploaded to a server. That's true for every step: corner detection, the perspective warp, and the final PDF assembly all happen locally on your device. Closing the tab without downloading means nothing was ever sent or stored anywhere else. For sensitive paperwork, that's a meaningfully different privacy posture than a scanning app that requires an account or a mobile app with cloud sync turned on by default.

Tips for a Cleaner Scan

A few habits noticeably improve the auto-detected corners. Shoot on a background with some contrast to the paper (a dark desk under a white page, not a white page on a white tablecloth) since the corner scan relies on a brightness jump at each edge. Even, diffuse lighting beats a single overhead light that casts a hard shadow across one side of the page, since a shadow can register as a false edge on that side's scan lines. If a corner still lands in the wrong place, drag it to the document's real corner before continuing. The perspective warp is only as accurate as the four points it's given, so a few seconds spent correcting a corner is worth more than reshooting the photo.