Aspose.OCR for Java 20.9 - Release Notes

All Features

Key Summary Category
OCRJAVA-77 Add new recognition result format:JSON Enhancement
OCRJAVA-76 Extend API with method which gets the uri-link on image in parameters Enhancement


API method with the next opportunities:

  • send URI-link for recognition;
  • send recognition options as an object
  • get recognition result as an object with different properties

Public API and Backwards Incompatible Changes


Method Description
RecognitionResult RecognizePageFromUri(string uri, RecognitionSettings settings) uri- link on the image, settings - object for parameters

Removed APIs

No Changes

Will be deprecated

String RecognizePage(String fullPath, Rectangle box);

String RecognizePage(BufferedImage image_, Rectangle box);

Usage Example

import static java.lang.System.out;

import java.awt.Rectangle;
import java.util.ArrayList;

import com.aspose.ocr.AsposeOCR;
import com.aspose.ocr.License;
import com.aspose.ocr.RecognitionResult;
import com.aspose.ocr.RecognitionSettings;

////  for gpu version

// import com.aspose.ocr.gpu.AsposeOCR;
// import com.aspose.ocr.gpu.License;
// import com.aspose.ocr.gpu.RecognitionResult;
// import com.aspose.ocr.gpu.RecognitionSettings;

public class App {
       public static void main(String[] args) {

        // set license
        // Check license
        boolean resLicense = License.isValid();
        out.println("License is :" + resLicense);  

        // Create api instance
        AsposeOCR api = new AsposeOCR();

       String uri = "";

       // set recognition options
       RecognitionSettings settings = new RecognitionSettings();
       ArrayList<Rectangle> rectangles = new ArrayList<Rectangle>();
       rectangles.add(new Rectangle(90,186,775,95));

       // get result object
       RecognitionResult result = null;
       try {
                result = api.RecognizePageFromUri(uri, settings);
            } catch (IOException e) {               

        // print result
        out.println("Result: \n" + result.RecognitionText+"\n\n");
        out.println("RecognitionAreasText: \n");
        for(String text: result.RecognitionAreasText) {
       out.println("JSON: \n" + result.GetJson());
       out.println("Warnings: \n");
       for(String warning: result.Warnings) {