OcrProvider


@ExperimentalPdfApi
public interface OcrProvider extends Closeable

Known direct subclasses
MlKitOcrProvider

Implementation of OcrProvider using ML Kit's Text Recognition.


Interface for processing images to recognize text.

Implementations should handle the complexity of OCR (Optical Character Recognition) processing and return a structured OcrResult that allows for spatial queries.

Summary

Public methods

abstract void
abstract OcrResult

Processes the given image and returns recognized text results.

Public methods

close

Added in 1.0.0-beta01
abstract void close()

recognizeText

abstract OcrResult recognizeText(@NonNull Bitmap image)

Processes the given image and returns recognized text results.

Parameters
@NonNull Bitmap image

The bitmap to process for text recognition.

Returns
OcrResult

An OcrResult containing the recognized text and its visual mapping, or null if no text was recognized or an error occurred.