Foxit::Library Class Reference

Class to represent the library management. More...

Static Public Member Functions

static ErrorCode GetLastError ()
 Get the last error code. More...
 
static Boolean Load (String^ licenseKey, String^ unlockCode)
 Load Foxit PDF SDK library. More...
 
static void Unload ()
 Unload current Foxit PDF SDK library. More...
 
static void LoadSystemFonts ()
 Load the installed local system fonts for Foxit PDF SDK. More...
 
static void SetAnnotIconProvider (Foxit::PDF::Annotations::AnnotIconProvider^ iconProvider)
 Set annotation icon provider to Foxit PDF SDK. More...
 
static Boolean RegisterSignatureHandler (String^ filter, String^ subfilter, SignatureHandler^ sigHandler)
 Register a third-party handler to Foxit PDF SDK for signing and verifying signature, along with the filter and sub-filter name of the handler. More...
 

Detailed Description

Class to represent the library management.

Any application should load Foxit PDF SDK by function Foxit::Library::Load before calling any PDF SDK methods. When there is no need to use Foxit PDF SDK any more, call function Foxit::Library::Unload to unload it.

Member Function Documentation

static ErrorCode Foxit::Library::GetLastError ( )
static

Get the last error code.

This function is called after another function is finished to get the error code value of previous called function.

Returns
Error code. Please refer to enumeration Foxit::ErrorCodeand this would be one of its value.
static Boolean Foxit::Library::Load ( String^  licenseKey,
String^  unlockCode 
)
static

Load Foxit PDF SDK library.

Applications should call this function to initialize Foxit PDF SDK library at first.
This function is using a default memory allocation strategy.

Parameters
[in]licenseKeyA String object that specifies the license key value.
[in]unlockCodeA String object that specifies license code value.
Returns
A boolean value: true means success, while false means failure.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::Param means the parameter licenseKey or unlockCode is nullptr, or their content is empty.
ErrorCode::Format means content in the parameter licenseKey or unlockCode is invalid or inapplicable.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.
static void Foxit::Library::LoadSystemFonts ( )
static

Load the installed local system fonts for Foxit PDF SDK.

This function should be called after the library is initialized and before loading a PDF document.

Returns
None.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.
static Boolean Foxit::Library::RegisterSignatureHandler ( String^  filter,
String^  subfilter,
SignatureHandler sigHandler 
)
static

Register a third-party handler to Foxit PDF SDK for signing and verifying signature, along with the filter and sub-filter name of the handler.

This function should be called first before signing or verifying a signature.

Parameters
[in]filterThe filter name of the signature handler. It should be valid and not empty.
[in]subfilterThe sub-filter name of the signature handler. It can be nullptr or empty.
[in]sigHandlerA PDF::SignatureHandler object that specifies the customized signature handler. User should ensure to implement all the delegate function members in signature handler.
Returns
A boolean value: true means register the handler successfully, while false means fail to register the handler.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::Param means parameter sigHandler is nullptr, or parameter filter is nullptr or empty.
ErrorCode::Handler means some delegate members in parameter sigHandler is nullptr.
ErrorCode::OutOfMemory means there is not enough memory or if the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.
static void Foxit::Library::SetAnnotIconProvider ( Foxit::PDF::Annotations::AnnotIconProvider iconProvider)
static

Set annotation icon provider to Foxit PDF SDK.

Among all types of annotations, note, stamp and fileattachment can be shown by icon:

  • For stamp annotation, its appearance can be either icon or bitmap. Currently, Foxit SDK PDF does not define default icon appearance. So, if user wants to use icon appearance for stamp annotation, this function should be called to set customized icon provider for stamp annotation.
  • For note and fileattachment, their appearance are icons, and Foxit SDK PDF has defined default icon appearance for them. If user wants to use customized icon appearance for, please call this function to set customized icon provider for note or fileattachment annotations. Foxit PDF SDK only keeps one customized icon provider, so when this function is called successfully, that means a new customized icon provider is set and will be used.
Parameters
[in]iconProviderAn Foxit::AnnotIconProvider object that specifies the customized icon provider. User should ensure to implement all the delegate function members in this icon provider.
Returns
None.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::Param means parameter iconProvider is nullptr or some delegate function members of iconProvider are still nullptr.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.
static void Foxit::Library::Unload ( )
static

Unload current Foxit PDF SDK library.

This function releases all internal resources and frees current Foxit PDF SDK library manager.

Returns
None.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::InvalidLibrary or ErrorCode::InvalidModule means Foxit PDF SDK library is not loaded.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Foxit Corporation