Foxit PDF Conversion SDK
foxit.common.Library Class Reference

Inherits SystemIDisposable.

Static Public Member Functions

static void EnableThreadSafety (bool is_enable_thread_safety)
 Enable thread safety. More...
 
static string GetVersion ()
 Get the version of current Foxit PDF Conversion SDK library. More...
 
static ErrorCode Initialize (string sn, string key)
 Initialize Foxit PDF Conversion SDK Library, with valid license information. More...
 
static ErrorCode Reinitialize ()
 Re-initialize Foxit PDF Conversion SDK Library. More...
 
static void Release ()
 Release all resource allocated by Foxit PDF Conversion SDK Library. More...
 

Detailed Description

This class represents the library management. It contains functions to initialize/re-initialize/release Foxit PDF Conversion SDK library, and also contains functions for global use.
Any application should load Foxit PDF Conversion SDK by function Library.Initialize before calling any other Foxit PDF Conversion SDK functions. When there is no need to use Foxit PDF Conversion SDK any more, please call function Library.Release .
Functions in Foxit PDF Conversion SDK may throw exception when some error occurs. User can catch these exceptions and check the error code with values starting from foxit.common.ErrorCode.e_ErrFile to know more about what error occurs.

Note
During the life-cycle of an application, Library.Initialize and Library.Release should be called in pair and can only be called once. Once Library.Release is called during the life-cycle of an application, Foxit PDF Conversion SDK cannot be initialized any more in the life-cycle of the application. Before Library.Release is called, if user wants to re-initialize Foxit PDF Conversion SDK, please refer to function Library.Reinitialize .

Member Function Documentation

◆ EnableThreadSafety()

static void foxit.common.Library.EnableThreadSafety ( bool  is_enable_thread_safety)
inlinestatic

Enable thread safety.

Parameters
[in]is_enable_thread_safetyEnable thread safety.true means to enable thread safety, while false means to disable thread safety.
Returns
None.

◆ GetVersion()

static string foxit.common.Library.GetVersion ( )
inlinestatic

Get the version of current Foxit PDF Conversion SDK library.

Returns
Version string.

◆ Initialize()

static ErrorCode foxit.common.Library.Initialize ( string  sn,
string  key 
)
inlinestatic

Initialize Foxit PDF Conversion SDK Library, with valid license information.

During the life-cycle of an application, this function can only be called once and should be called first before any other functions in Foxit PDF Conversion SDK can be called.
Once function Library.Release is called, Foxit PDF Conversion SDK library cannot be initialized any more in the life-cycle of the application.

Parameters
[in]snString of sn information, which can be retrieved from "SN=" part in key file "gsdk_sn.txt" or "rdk_sn.txt".
[in]keyString of key information, which can be retrieved from "Sign=" part in key file "gsdk_key.txt" or "rdk_key.txt".
Returns
foxit.common.ErrorCode.e_ErrSuccess means success.
foxit.common.ErrorCode.e_ErrInvalidLicense means input license information is invalid.
foxit.common.ErrorCode.e_ErrParam means parameter sn or key is an empty string.
For more information about error code values, please refer to values starting from foxit.common.ErrorCode.e_ErrSuccess .

◆ Reinitialize()

static ErrorCode foxit.common.Library.Reinitialize ( )
inlinestatic

Re-initialize Foxit PDF Conversion SDK Library.

When user meets out-of-memory error or user wants to re-initialize Foxit PDF Conversion SDK library before function Library.Release is called, user can call this function to re-initialize Foxit PDF Conversion SDK Library.
Once function Library.Release is called, Foxit PDF Conversion SDK library cannot be initialized any more in the life-cycle of the application.

Returns
foxit.common.ErrorCode.e_ErrSuccess means success. For more information about error code values, please refer to values starting from foxit.common.ErrorCode.e_ErrSuccess .

◆ Release()

static void foxit.common.Library.Release ( )
inlinestatic

Release all resource allocated by Foxit PDF Conversion SDK Library.

User should call this function to release all memory blocks allocated by the library.
Once this fucntion is called, Foxit PDF Conversion SDK library cannot be initialized any more in the life-cycle of the application.

Returns
None.