Getting recognition results as text
Contents
[
Hide
]
Recognition results in plain text with line breaks are returned by default from any recognition method, unless you directly specify another output format in recognition settings.
std::string image_path = "source.png";
// prepare buffer for result (in symbols, len_byte = len * sizeof(wchar_t))
const size_t len = 4096;
wchar_t buffer[len] = { 0 };
// extract text
size_t size = aspose::ocr::page(image_path.c_str(), buffer, len);
// print result
std::wcout << buffer << L"\n";
You can also extract text blocks from specific image areas or get individual lines.