Getting recognition results as JSON

Contents
[ ]

Aspose.OCR for Java can return recognition results in JSON format - de facto data exchange standard for websites and REST APIs. To get the results as JSON, use GetJson method 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].GetJson());