ComPDFKit Conversion C++ SDK 3.0.0
API Documentation
compdfkit::common::LibraryManager Class Reference

Manages all operations related to the SDK library. More...

#include <library_manager.h>

Static Public Member Functions

static base::ErrorCode LicenseVerify (const char *license, const char *device_id, const char *app_id)
 Verifies the provided license key along with device ID and application ID.
 
static void Initialize (const char *resource_path)
 Initializes the SDK library with the given resource path as a C-string.
 
static void Initialize (const wchar_t *resource_path)
 Initializes the SDK library with the given resource path as a wide-character string.
 
static void Release ()
 Releases all resources used by the library. Should be called when the SDK is no longer needed.
 
static void SetLogger (bool enable_info, bool enable_warning)
 Enables or disables logging for info and warning messages.
 
static void SetProgress (COMProgress progress)
 Sets a callback function to track the progress of SDK operations.
 
static void GetVersion (char *version)
 Gets the version of the SDK library.
 
static int GetPageCount (const char *file_path, const char *password)
 Returns the number of pages in a document.
 
static int GetPageCount (const wchar_t *file_path, const wchar_t *password)
 Returns the number of pages in a document.
 
static base::ErrorCode SetDocumentAIModel (const char *file_path, base::OCRLanguage language)
 Sets the Document AI model for OCR based on the provided file path and language.
 
static base::ErrorCode SetDocumentAIModel (const wchar_t *file_path, base::OCRLanguage language)
 Sets the Document AI model for OCR based on the provided file path and language.
 
static void SetOCRLanguage (base::OCRLanguage language)
 Sets the OCR language for document processing.
 
static void SetOCRResult (const char *json_str)
 Sets OCR result data from a JSON string.
 

Detailed Description

Manages all operations related to the SDK library.

The LibraryManager class serves as a central hub for managing the lifecycle of an SDK library. It provides functionalities such as initializing the library with specified resources, verifying licenses, installing fonts, setting up logging and progress callbacks, retrieving version information, and counting pages in documents.

Member Function Documentation

◆ GetPageCount() [1/2]

static int compdfkit::common::LibraryManager::GetPageCount ( const char * file_path,
const char * password )
static

Returns the number of pages in a document.

Parameters
[in]file_pathPath to the document file.
[in]passwordPassword for opening the document (if required).
Returns
The total number of pages in the document.

◆ GetPageCount() [2/2]

static int compdfkit::common::LibraryManager::GetPageCount ( const wchar_t * file_path,
const wchar_t * password )
static

Returns the number of pages in a document.

Parameters
[in]file_pathPath to the document file as a wide-character string.
[in]passwordPassword for opening the document (if required) as a wide-character string.
Returns
The total number of pages in the document.

◆ GetVersion()

static void compdfkit::common::LibraryManager::GetVersion ( char * version)
static

Gets the version of the SDK library.

Parameters
[out]versionA pre-allocated buffer where the version string will be copied.

◆ Initialize() [1/2]

static void compdfkit::common::LibraryManager::Initialize ( const char * resource_path)
static

Initializes the SDK library with the given resource path as a C-string.

This method should be called before any other SDK function is invoked.

Parameters
[in]resource_pathPath to the resources needed by the SDK.

◆ Initialize() [2/2]

static void compdfkit::common::LibraryManager::Initialize ( const wchar_t * resource_path)
static

Initializes the SDK library with the given resource path as a wide-character string.

This method should be called before any other SDK function is invoked.

Parameters
[in]resource_pathPath to the resources needed by the SDK.

◆ LicenseVerify()

static base::ErrorCode compdfkit::common::LibraryManager::LicenseVerify ( const char * license,
const char * device_id,
const char * app_id )
static

Verifies the provided license key along with device ID and application ID.

Parameters
[in]licenseThe license key string to be verified.
[in]device_idA unique identifier for the device.
[in]app_idAn identifier for the application using the SDK.
Returns
base::ErrorCode indicating the success or failure of the verification process.

◆ Release()

static void compdfkit::common::LibraryManager::Release ( )
static

Releases all resources used by the library. Should be called when the SDK is no longer needed.

◆ SetDocumentAIModel() [1/2]

static base::ErrorCode compdfkit::common::LibraryManager::SetDocumentAIModel ( const char * file_path,
base::OCRLanguage language )
static

Sets the Document AI model for OCR based on the provided file path and language.

Parameters
[in]file_pathPath to the Document AI model file.
[in]languageThe language for OCR processing.
Returns
base::ErrorCode indicating the success or failure of setting the model.

◆ SetDocumentAIModel() [2/2]

static base::ErrorCode compdfkit::common::LibraryManager::SetDocumentAIModel ( const wchar_t * file_path,
base::OCRLanguage language )
static

Sets the Document AI model for OCR based on the provided file path and language.

Parameters
[in]file_pathPath to the Document AI model file as a wide-character string.
[in]languageThe language for OCR processing.
Returns
base::ErrorCode indicating the success or failure of setting the model.

◆ SetLogger()

static void compdfkit::common::LibraryManager::SetLogger ( bool enable_info,
bool enable_warning )
static

Enables or disables logging for info and warning messages.

Parameters
[in]enable_infoTrue if info messages should be logged; false otherwise.
[in]enable_warningTrue if warning messages should be logged; false otherwise.

◆ SetOCRLanguage()

static void compdfkit::common::LibraryManager::SetOCRLanguage ( base::OCRLanguage language)
static

Sets the OCR language for document processing.

Parameters
[in]languageThe language for OCR processing.

◆ SetOCRResult()

static void compdfkit::common::LibraryManager::SetOCRResult ( const char * json_str)
static

Sets OCR result data from a JSON string.

Parameters
[in]json_strJSON string containing OCR results.

◆ SetProgress()

static void compdfkit::common::LibraryManager::SetProgress ( COMProgress progress)
static

Sets a callback function to track the progress of SDK operations.

Parameters
[in]progressA pointer to the COMProgress callback function.

The documentation for this class was generated from the following file: