Most free document scanners upload your pages to a server for text recognition. Passports, tax forms and receipts included. There's no technical need for that on a modern phone, so I built LumenScan as an experiment in doing all of it locally. This is how it's put together.
The stack
Capture: VNDocumentCameraViewController from VisionKit, the same component Apple Notes uses. You get live edge detection, auto-capture, multi-page flow and a corner editor for free. I first wrote a custom AVFoundation camera, then dropped it as the main path; it now only runs on simulators or devices without Apple's scanner.
OCR: the Vision framework's text recognition, on device. I set it up to cover English plus Hindi, Tamil and Telugu, since the first target market was India.
PDF: PDFKit builds the output and handles annotation and signing.…