Browse our Products

Aspose.OCR for C++ 22.7 Release Notes (July 2022)

What was changed

The original image is added to the background when saving the recognition results in PDF format.Enhancement

Public API changes and backwards compatibility

This section lists all public API changes introduced in Aspose.OCR for C++ 22.7 that may affect the code of existing applications.

Added public APIs:

No changes.

Updated public APIs:

No changes.

Removed public APIs:

No changes.

Application logic changes

This section lists any changes to architecture, recognition algorithms, and API logic introduced in Aspose.OCR for C++ 22.7 that may affect the behavior of existing applications.

Saving recognition results as PDF

When saving recognition results in PDF format, the original (recognized) image is placed on the background of the resulting document. The recognized text is added as an invisible overlay on top of the background image and can be searched and copied to the clipboard.

This behavior is enabled by default when saving PDFs and cannot be configured or disabled.

Usage examples

The example below (C++ 17) illustrates saving recognition results in PDF format:

#include <iostream>
#include <aspose_ocr.h>
#include <filesystem>
#include <corecrt_io.h>
#include <fcntl.h>

int main()
    _setmode(_fileno(stdout), _O_U16TEXT);

    // Current directory
    std::filesystem::path path{ std::filesystem::current_path() };

    // Licensing
    const std::string lic = "/Aspose.Total.lic";
    std::filesystem::path license = path.string() + lic;
    bool lic_result = asposeocr_get_state();

    // Saving recognition results to PDF
    RecognitionSettings settings;
    settings.save_format = file_format::pdf;
    asposeocr_page_save("source.png", "target.pdf", settings);