Where do I find LanguageResources.zip?

Hello,

I am trying to use Aspose OCR with Portuguese and found this page: https://docs.aspose.com/ocr/java/languages/

The page talks about a LanguageResources.zip to load, but I can’t find it. The links below go to a different place (.net aspose).

Can you guys help please?

Hi Mario,

Thank you for your inquiry.

Following is the required link to download the Java language resources:

Aspose.OCR for Java Resources

Hello Ikram, thanks for the answer.

But I’m still confused… The files in this page are:

Aspose.OCR for Java 2.4.0

Resource file for Aspose.OCR for Java 2.0.0

Resource file for Aspose.OCR for Java 1.9.0

Resource file for Aspose.OCR for Java 1.5.0

My Aspose.OCR version is the latest (17.01) and neither of the above files contain LanguageResources.zip

Hi Mario,

Thank you for writing us back.

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.

Hello Ikram,


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.

[]'s
Hi Mario,

Sorry for the inconvenience caused.

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));

ocr.getLanguageContainer().clear();
ocr.getLanguageContainer().addLanguage(com.aspose.ocr.LanguageFactory.load("French_language_resource_file_for_Aspose.OCR_for_.NET_3.2.0.zip"));
if (ocr.process())
{
System.out.println(ocr.getText());
}
else
{
System.out.println("Error reading image");
}

Hope the above information helps. Feel free to contact us in case of any query or comments.

So I can use the resources from .NET with Java code, right?!

Hi Mario,

Yes, you can use the resources from .NET with Java code. Language specific resources for .Net and Java are same.