Licensing

If you want to test Aspose.OCR without evaluation version limitations, request a 30-day temporary license. Please refer to How to get a Temporary License? for more information.

Evaluation Version Limitations

The evaluation version of Aspose.OCR (that is, the component running without a license applied) limits the number of characters extracted from an image to 50.

Setting a License

The license is a plain text XML file that contains details such as the product name, number of developers it is licensed to, subscription expiry date and so on. The file is digitally signed, so do not modify the file; even the inadvertent addition of an extra line break into the file will invalidate it.

You need to apply a license before starting the character and/or marker recognition process. You are only required to set a license once per application or process.

The license can be loaded from a stream or file in the following locations:

  1. Explicit path.
  2. The folder that contains the Aspose.OCR.jar.

Use the License.setLicense method to license the component. Often the easiest way to set a license is to put the license file in the same folder as Aspose.OCR.jar and specify just the file name without path as shown in the following example:

Example 1

In this example Aspose.OCR will attempt to find the license file in the folder that contain the JARs of your application.

Java

 com.aspose.ocr.License license = new com.aspose.ocr.License();

license.setLicense("Aspose.OCR.Java.lic");

Example 2

Initializes a license from a stream.

Java

 com.aspose.ocr.License license = new com.aspose.ocr.License();

license.setLicense(new java.io.FileInputStream("Aspose.OCR.Java.lic"));

Validate the License

It is possible to validate if the license has been set properly or not. The License class has the isLicensed field that will return true if license has been properly set.

Java

 License license = new License();

license.setLicense("Aspose.OCR.Java.lic");

if (License.isLicensed()) {

    System.out.println("License is Set!");

}