Menu

Building a document scanner where OCR never leaves the phone (VisionKit + Vision + PDFKit)
📰

Building a document scanner where OCR never leaves the phone (VisionKit + Vision + PDFKit)

DEV Community: ios·Nova Lumen Labs·about 23 hours ago
#I9gEcv58
#devtoios#devto#dev#lumenscan#apple
Reading 0:00
15s threshold

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.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.