Skip to content

Instantly share code, notes, and snippets.

Convert Image to JSON with OCR in C# | PNG to JSON | JPG JPEG to JSON
// Initialize an instance of AsposeOcr class
AsposeOcr api = new AsposeOcr();
// Recognize the input image
RecognitionResult result = api.RecognizeImage("sample.png", new RecognitionSettings
{
AutoSkew = true,
ThresholdValue = 230,
Language = Language.Eng
});
// Print result as JSON
Console.WriteLine($"JSON: {result.GetJson()}");
// Initialize an instance of AsposeOcr class
AsposeOcr api = new AsposeOcr();
// Recognize the input image
RecognitionResult result = api.RecognizeImage("sample.png", new RecognitionSettings());
// Print result as JSON
Console.WriteLine($"JSON: {result.GetJson()}");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment