Getting recognition results as JSON

[ ]

Aspose.OCR for .NET 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 Aspose.OCR.RecognitionResult object.

Set isReadable parameter of the method to true to get a JSON string in a human-readable format with line breaks and auto-indentation.

Aspose.OCR.AsposeOcr recognitionEngine = new Aspose.OCR.AsposeOcr();
Aspose.OCR.RecognitionSettings recognitionSettings = new Aspose.OCR.RecognitionSettings();
Aspose.OCR.RecognitionResult result = recognitionEngine.RecognizeImage("source.png", recognitionSettings);
string json = result.GetJson(true);