OcrRunnerEngine class
A PdfOcrEngine over any OcrModelRunner: reads the page raster into an
OcrImage, runs the backend, and maps each recognized line's pixel box to
PDF user space via PdfOcrPageImage.userSpaceRect. The engine (and the
geometry it owns) is independent of which recognizer runs - the native
OnDeviceOcrEngine and the web build both use it.
Web-safe: nothing here touches dart:io or FFI.
- Implementers
Constructors
- OcrRunnerEngine(OcrModelRunner runner, {double minConfidence = 0})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- minConfidence → double
-
Lines below this confidence are dropped before mapping.
final
- runner → OcrModelRunner
-
The inference backend.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
) → Future< void> - Releases the backend.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
recognize(
PdfOcrPageImage page) → Future< List< PdfOcrSpan> > -
Recognizes the text on
page. Returns onePdfOcrSpanper word (or line) with its user-space bounds and confidence. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
pixelRatioFor(
PdfPage page, {double target = 3, int maxSidePixels = 4000}) → double -
The raster resolution (pixels per PDF point) to OCR
pageat:target(3 = 216 dpi) unless that would make the page's longest side exceedmaxSidePixels, in which case the ratio that fits it exactly.