OcrReader class

Constructors

OcrReader({bool validateDocument = false, bool maskAadhaar = false, OcrValidator? validator})

Properties

hashCode → int
The hash code for this object.
no setterinherited
maskAadhaar ↔ bool
When true, automatically masks Aadhaar numbers if detected.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
validateDocument ↔ bool
When true, rejects empty and handwritten images.
getter/setter pair
validator → OcrValidator
Custom validator thresholds.
final

Methods

dispose() → Future<void>
Release native resources.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readFromBytes(Uint8List bytes, {DetectedDocType? docType}) → Future<OcrResult>
Recognize English text from raw image bytes. Automatically enhances and retries if the first OCR pass is low-quality. docType — hint the document type to apply correct handwriting policy.
readFromFile(File file, {DetectedDocType? docType}) → Future<OcrResult>
Recognize English text from a File. docType — hint the document type to apply correct handwriting policy.
readFromPath(String imagePath, {DetectedDocType? docType}) → Future<OcrResult>
Recognize English text from an image file path. Automatically enhances and retries if the first OCR pass is low-quality. docType — hint the document type to apply correct handwriting policy.
readFromPdf(Uint8List pdfBytes, {int page = 0, double scale = 2.0, DetectedDocType? docType}) → Future<OcrResult>
Recognize text from a PDF file (renders page to image first). page — zero-based page index (default 0). scale — render quality (default 2.0, higher = better OCR but slower). docType — hint the document type to apply correct handwriting policy. Uses native PDF rendering — no third-party packages needed.
readFromPdfFile(File pdfFile, {int page = 0, double scale = 2.0, DetectedDocType? docType}) → Future<OcrResult>
Recognize text from a PDF file path. docType — hint the document type to apply correct handwriting policy.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited