Extracting text from URL
Contents
[
Hide
]
Aspose.OCR for Java can recognize images hosted on websites without downloading them to your computer. The only thing you need is the URL. Use RecognizePageFromUri
method of AsposeOCR
class. This method supports JPEG, PNG, BMP, GIF, and single-page TIFF images.
This method does not support authentication and can only work with public links.
This method allows you to optionally customize recognition accuracy, performance, and other settings.
Depending on the parameters, the method can either return a string with line breaks, or a RecognitionResult
object that allows you to perform advanced manipulations with recognition results: automatically correct spelling, get image regions and save results in various formats.
AsposeOCR api = new AsposeOCR();
// Customize recognition
RecognitionSettings recognitionSettings = new RecognitionSettings();
recognitionSettings.setLanguage(Language.Ukr);
// Extract text from image provided as URL
RecognitionResult result = api.RecognizePageFromUri("https://upload.wikimedia.org/wikipedia/commons/e/e4/Biggle_horse_book_%28Page_45%29_BHL23865068.jpg", recognitionSettings);
System.out.println("Recognition result:\n" + result + "\n\n");