The java resource page contains different versions of the resource file. Latest version is Aspose.OCR for Java 2.4.0. Please do not confuse yourself with the file name. Resource file name has been changed. The latest version of resource file has name Aspose.OCR_for_Java_2.4.0.zip. We will reflect this change on the documentation page very soon.
I tried with this file (Aspose.OCR_for_Java_2.4.0.zip) and got the following error:
Exception in thread “main” class com.aspose.ocr.internal.cl: Resource file is not correct. —> class com.aspose.ocr.internal.cl: Can’t find “data.xml” file in resources. —> class com.aspose.ocr.internal.hw: java.lang.NullPointerException —> java.lang.NullPointerException
Also, where do I choose Portuguese??? I’m not getting this process at all.
This is to update you that if you want to perform OCR operation on a scanned image containing writing other than English, requires loading language specific resources. Language specific resources for .Net and Java are same. These resources can be downloaded from link Resources. Following is the sample Java code snippet:
String imagePath = "french_sample.jpg"; OcrEngine ocr = new OcrEngine();
ocr.setImage(ImageStream.fromFile(imagePath));