Easily convert images to text and create searchable PDFs with our powerful and developer-friendly OCR API. Integrate OCR functionality into your Windows applications with minimal code. Extract editable text from scanned documents, photos, screenshots, and more, handling various fonts, layouts, and styles. Bulk-recognize entire folders and archives of images, and process multi-page PDFs and TIFFs. Aspose.OCR for C++ is well-fit for global scale content digitization. It supports a vast range of languages across Europe, Middle East, Asia, Africa, and the Americas, including the ability to recognize mixed languages within a document. This versatile library empowers businesses of all sizes, from startups to global corporations. Changelog: - Minor improvements and fixes.
$ dotnet add package Aspose.Ocr.Cpp ![Downloads]Windows-CPU / Windows-GPU / Linux-CPU / Linux-GPU
Product Page | Docs | Demos | API Reference | Examples | Blog | Search | Free Support | Temporary License
This package can be used to develop applications for different operating systems and platforms. You can build both 32-bit and 64-bit software.
Please note: Aspose.OCR for C++ requires ONNX Runtime 1.11.0 or later (CPU / GPU).
Aspose.OCR for C++ can extract text from photos, scans, PDF documents and other graphical files. It allows you to add OCR functionality to a desktop or web application in less than 10 lines of code, without having to delve into complex mathematical operations, neural networks, and other technical details.
Aspose.OCR can recognize a large number of languages and all popular writing scripts, including texts with mixed languages.
Aspose.OCR for C++ can recognize just about any file that you get from a scanner or camera, or download from the Internet:
Recognition results are returned in the most popular document and data exchange formats:
You can get familiar with Aspose.OCR for C++ by creating a minimal console application for extracting text from an image.
source.png.AsposeOCRInput structure:
string file = current_dir + "/source.png";
AsposeOCRInput source;
source.url = file.c_str();
std::vector<AsposeOCRInput> content{ source };
RecognitionSettings settings;
settings.language_alphabet = language::eng;
auto result = asposeocr_recognize(content.data(), content.size(), settings);
wchar_t* buffer = asposeocr_serialize_result(result, buffer_size, export_format::text);
std::cout << std::wstring(buffer) << std::endl;
asposeocr_free_result(result);
Full code:
// Provide the image
string file = current_dir + "/source.png";
AsposeOCRInput source;
source.url = file.c_str();
std::vector<AsposeOCRInput> content{ source };
// Set recognition language
RecognitionSettings settings;
settings.language_alphabet = language::eng;
// Extract text from the image
auto result = asposeocr_recognize(content.data(), content.size(), settings);
// Output the recognized text
wchar_t* buffer = asposeocr_serialize_result(result, buffer_size, export_format::text);
std::cout << std::wstring(buffer) << std::endl;
// Release the resources
asposeocr_free_result(result);Run the program. You will see the extracted text in the console output. If the text is too large, the result may be cut off due to trial restrictions. You can get a temporary license to remove all limitations of the trial version for 30 days.