Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Created August 2, 2025 04:54
Show Gist options
  • Save aspose-com-gists/2e06e8d50f0b532ce3c28b855bc3a350 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/2e06e8d50f0b532ce3c28b855bc3a350 to your computer and use it in GitHub Desktop.
Convert Image Text to Editable Text Using Aspose.OCR
// Initialize AsposeOCR recognition engine
Aspose.OCR.AsposeOcr recognitionEngine = new Aspose.OCR.AsposeOcr();
// Load and recognize an image
string result = recognitionEngine.RecognizeImage("sample.jpg");
// Show results
Console.WriteLine(result);
// Initialize AsposeOCR recognition engine
AsposeOCR api = new AsposeOCR();
// Load and recognize an image
String result = RecognizePage("sample.jpg");
// Show results
System.out.println("Recognition result:\n" + result + "\n\n");
import aspose.ocr as ocr
# Instantiate Aspose.OCR API
api = ocr.AsposeOcr()
# Add image to the recognition batch
img = ocr.OcrInput(ocr.InputType.SINGLE_IMAGE)
img.add("sample.jpg")
# Recognize the image
result = api.recognize(img)
# Print recognition result
print(result[0].recognition_text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment