Getting recognition results as text
Contents
[
Hide
]
Recognition results in plain text with line breaks can be obtained from the recognitionText
property of RecognitionResult
object.
AsposeOCR api = new AsposeOCR();
// Add an image to OcrInput object
OcrInput input = new OcrInput(InputType.SingleImage);
input.Add("source.png");
// Recognize image
ArrayList<RecognitionResult> results = api.Recognize(input);
// Save result
System.out.println(results[0].recognitionText);
You can also extract text blocks from specific image areas or get individual lines.