Licensing
Aspose.OCR for C++ is a commercially licensed product that can be used in trial (evaluation) mode.
Free trial
You can start using Aspose.OCR for C++ right after the installation. In trial mode (without providing a license) you can recognize texts in any supported languages and save recognition results in any of the supported formats.
However, the following restrictions apply:
- If the number of characters in a recognized image exceeds 100, only the first 100 characters are recognized.
- You cannot recognize more than 500 characters per application launch, even when processing text from multiple images or regions within a single image.
Apply a license to remove the restriction.
Getting a temporary license
A temporary license removes a limitation of the trial version for 30 days. Use it to start building a fully functional OCR application and make the final decision to purchase Aspose.OCR for C++ later.
To request a temporary license, visit “Get a Temporary License” page.
Purchasing a license
Aspose.OCR for C++ is licensed either by the number of developers and locations (sites) where the products will be used (Developer and Site licenses) or by pay-per-use (Metered licenses).
Read License Types for details and purchase a license that best suits your needs.
Applying a developer or site license
After purchasing a license or obtaining a temporary license, you will receive a file with .lic extension. If needed, you can rename this file and change its extension.
The license must be applied once per application or process lifecycle before recognition starts. For desktop applications, it is recommended to load the license in the Initialize
function of the main form. For web applications, load it in the Session_Start()
function of global.asax file.
Loading a license from file
Put the license file to a folder on your computer and insert the following code in your startup function:
const std::string lic = "Aspose_OCR_License_File.lic";
aspose::ocr::set_license(lic.c_str());
If only the name of the license file (without path) is specified, set_license
function will look for the license file in the following locations:
- the folder that contains Aspose.OCR for C++ component (Aspose.OCR.dll);
- the folder that contains the application’s executable file.
Alternatively, you can store the license file in any folder on your computer and specify an absolute or relative path. If you prefer to load the license from the explicit path, provide the full path in set_license
function.
Checking the license state
To validate whether the license is valid, use the following code:
std::wcout << aspose::ocr::get_state() << '\n';
This code will return true
if the license is set and valid and false
if there is a problem with the license.
Licensing multiple Aspose products
Even if you have a single license for all Aspose products (such as Aspose.Total for C++), you still need to apply the license separately to each Aspose product you are using in your application.