Foxit PDF SDK

Static Public Member Functions | List of all members
foxit::common::Library Class Reference

Inherits Object.

## Static Public Member Functions
static bool | AddExternalFontPath (const wchar_t *font_path)
| Add external font path. More...
static void * | Alloc (size_t size)
| Allocate a memory block. More...
static bool | EnableJavaScript (bool enable_javascript)
| Enable or disable javascript for PDF. More...
static void | EnableThreadSafety (bool is_enable_thread_safety)
| Enable thread safety. More...
static WString | ExecuteJavaScript (const wchar_t *java_script)
| Execute javascript. More...
static foxit::ErrorCode | FlushLog ()
| Flush the log file. More...
static void | Free (void *ptr)
| Free a memory block. More...
static RenderConfig | GetRenderConfig ()
| Get the rendering configuration. More...
static String | GetVersion ()
| Get the version of current Foxit PDF SDK library. More...
static bool | HasModuleLicenseRight (common::ModuleName module_name)
| Check if user has right to use a specified module of Foxit PDF SDK in current used license information (which is used to initialize Foxit PDF SDK). More...
static ErrorCode | Initialize (const char *sn, const char *key)
| Initialize Foxit PDF SDK Library, with valid license information. More...
static ErrorCode | Initialize (const char *sn, const char *key, bool is_optimize_memory, bool enable_js_xfa_threadsafety=false)
| Initialize Foxit PDF SDK Library, with valid license information. More...
static void | MatchExternalFontsOnly (bool only_match)
| Specify whether to match fonts only from external fonts. More...
static void * | Realloc (void *ptr, size_t new_size)
| Reallocate a memory block. More...
static bool | RegisterSecurityCallback (const char *filter, pdf::SecurityCallback *callback)
| Register a pdf::SecurityCallback object to Foxit PDF SDK for decryption of the PDFs with special encryption filters. More...
static bool | RegisterSignatureCallback (const char *filter, const char *sub_filter, pdf::SignatureCallback *signature_callback)
| Register a third-party pdf::SignatureCallback object to Foxit PDF SDK for signing and verifying signature, along with the filter and sub filter name of the callback. More...
static void | RegisterXFAAppProviderCallback (addon::xfa::AppProviderCallback *callback)
| Register an addon::xfa::AppProviderCallback object to Foxit PDF SDK. More...
static ErrorCode | Reinitialize ()
| Re-initialize Foxit PDF SDK Library. More...
static void | Release ()
| Release all resource allocated by Foxit PDF SDK Library. More...
static bool | SetActionCallback (ActionCallback *action_callback)
| Set a foxit::ActionCallback object to Foxit PDF SDK, in aid of performing PDF actions. More...
static bool | SetAnnotIconProviderCallback (pdf::annots::IconProviderCallback *annot_icon_provider)
| Set a customized pdf::annots::IconProviderCallback object to Foxit PDF SDK. More...
static bool | SetCacheSize (uint32 size)
| Set the upper limit of PDF library cache size. More...
static void | SetDefaultICCProfilesPath (const wchar_t *icc_profile_folder_path)
| Set path of folder which contains default ICC profile files. More...
static bool | SetDocEventCallback (DocEventCallback *callback)
| Set a DocEventCallback object to Foxit PDF SDK. More...
static bool | SetFontMapperCallback (FontMapperCallback *callback)
| Set a FontMapperCallback object to Foxit PDF SDK. More...
static void | SetLogFile (const char *log_file_path)
| Set the log file path. More...
static void | SetLogFile (const wchar_t *log_file_path)
| Set the log file path. More...
static void | SetLogFile (foxit::common::file::StreamCallback *log_file)
| Set the log file stream. More...
static bool | SetNotifierCallback (NotifierCallback *notifier)
| Set a NotifierCallback object to Foxit PDF SDK. More...
static void | SetRenderConfig (const RenderConfig &render_config)
| Set the rendering configuration. More...
static void | SetRenderTextGamma (float gamma)
| Set gamma value for text rendering. More...
static bool | SetTimeStampCallback (pdf::TimeStampCallback *timestamp_callback)
| Set a pdf::TimeStampCallback object to Foxit PDF SDK, in aid of interacting with time stamp server. More...
static bool | UnregisterSecurityCallback (const char *filter)
| Unregister a pdf::SecurityCallback object from Foxit PDF SDK. More...
static void | UnregisterSignatureCallback (const char *filter, const char *sub_filter)
| Unregister the third-party pdf::SignatureCallback object, which is associated with a specific filter and sub-filter, from the Foxit PDF SDK. If a default signature is available, it will be restored together with its filter and sub-filter values. More...

## Detailed Description

This class represents the library management. It contains functions to initialize/re-initialize/release Foxit PDF SDK library, and also contains functions for global use.
Any application should load Foxit PDF SDK by function Library::Initialize before calling any other Foxit PDF SDK functions. When there is no need to use Foxit PDF SDK any more, please call function Library::Release.
Functions in Foxit PDF SDK may throw exception when some error occurs. User can catch these exceptions and check the error code with values starting from foxit::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 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 SDK, please refer to function Library::Reinitialize.

## Member Function Documentation

## ◆ AddExternalFontPath()

static bool foxit::common::Library::AddExternalFontPath | ( | const wchar_t * | font_path | ) |
| static

Add external font path.

Parameters

  [in] | font_path | The external font path.

Returns
  true means success, while false means failure.

## ◆ Alloc()

static void* foxit::common::Library::Alloc | ( | size_t | size | ) |
| static

Allocate a memory block.

When the memory block is not used any more, please remember to call function Library::Free to free the memory block.

Parameters

  [in] | size | The number of bytes to be allocated.

Returns
  Pointer to the allocated memory block.

## ◆ EnableJavaScript()

static bool foxit::common::Library::EnableJavaScript | ( | bool | enable_javascript | ) |
| static

Enable or disable javascript for PDF.

Javascript for PDF is enabled by default.

Parameters

  [in] | enable_javascript | true means to enable javascript, and false means to disable javascript. If this function is not called, javascript for PDF is enabled by default.

Returns
  true means success, while false means failure.

## ◆ EnableThreadSafety()

static void foxit::common::Library::EnableThreadSafety | ( | bool | is_enable_thread_safety | ) |
| static

Enable thread safety.

From Foxit PDF SDK 11.0, document level thread safety is enabled by default except Javascript and xfa module without calling this function. This function will be deprecated in future version. And users need to ensure that one pdf document is only operated by one thread at a time. If users want to enable thread safety for javascript and xfa module, please pass the true to the enable_js_xfa_threadsafety during calling function Library::Initialize.

Currently, module "OCR" does not support thread safety.

Parameters

  [in] | is_enable_thread_safety | Enable thread safety.true means to enable thread safety, while false means to disable thread safety.

Returns
  None.

## ◆ ExecuteJavaScript()

static WString foxit::common::Library::ExecuteJavaScript | ( | const wchar_t * | java_script | ) |
| static

Execute javascript.

Parameters

  [in] | java_script | The javascript which needs to be executed.

Returns
  The result error information, such as syntax error warning, unsupported warning, and other error messages.

## ◆ FlushLog()

static foxit::ErrorCode foxit::common::Library::FlushLog | ( |  | ) |
| static

Flush the log file.

Returns
  Error code.

## ◆ Free()

static void foxit::common::Library::Free | ( | void * | ptr | ) |
| static

Free a memory block.

Parameters

  [in] | ptr | Pointer to a memory block allocated by function Library::Alloc to be released.

Returns
  None.

## ◆ GetRenderConfig()

static RenderConfig foxit::common::Library::GetRenderConfig | ( |  | ) |
| static

Get the rendering configuration.

Returns
  A rendering configuration object which shows current configuration.

## ◆ GetVersion()

static String foxit::common::Library::GetVersion | ( |  | ) |
| static

Get the version of current Foxit PDF SDK library.

Returns
  Version string.

## ◆ HasModuleLicenseRight()

static bool foxit::common::Library::HasModuleLicenseRight | ( | common::ModuleName | module_name | ) |
| static

Check if user has right to use a specified module of Foxit PDF SDK in current used license information (which is used to initialize Foxit PDF SDK).

In Foxit PDF SDK, once the library is initialized successfully, most feature can be used. But for some special features, they can be used only when specified modules are defined in license information. This function can be used to check if user has right for these special modules before using these feature.

Parameters

  [in] | module_name | Name of the module whose right is to be checked. Please refer to values starting from common::e_ModuleNameConnectedPDF and this should be one of these values.

Returns
  true means user has right to use the specified module, while false means user does not have right to use the specified module.

## ◆ Initialize() [1/2]

static ErrorCode foxit::common::Library::Initialize | ( | const char * | sn,
|  | const char * | key
| ) |  |
| static

Initialize Foxit PDF 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 SDK can be called.
Once function Library::Release is called, Foxit PDF SDK library cannot be initialized any more in the life-cycle of the application.

Parameters

  [in] | sn | String of sn information, which can be retrieved from "SN=" part in key file "gsdk_sn.txt" or "rdk_sn.txt".
  [in] | key | String of key information, which can be retrieved from "Sign=" part in key file "gsdk_key.txt" or "rdk_key.txt".

Returns
  foxit::e_ErrSuccess means success.
  foxit::e_ErrInvalidLicense means input license information is invalid.
  foxit::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::e_ErrSuccess.

## ◆ Initialize() [2/2]

static ErrorCode foxit::common::Library::Initialize | ( | const char * | sn,
|  | const char * | key,
|  | bool | is_optimize_memory,
|  | bool | enable_js_xfa_threadsafety = `false`
| ) |  |
| static

Initialize Foxit PDF 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 SDK can be called.
Once function Library::Release is called, Foxit PDF SDK library cannot be initialized any more in the life-cycle of the application.

Parameters

  [in] | sn | String of sn information, which can be retrieved from "SN=" part in key file "gsdk_sn.txt" or "rdk_sn.txt".
  [in] | key | String of key information, which can be retrieved from "Sign=" part in key file "gsdk_key.txt" or "rdk_key.txt".
  [in] | app_name | String of app name.

Returns
  foxit::e_ErrSuccess means success.
  foxit::e_ErrInvalidLicense means input license information is invalid.
  foxit::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::e_ErrSuccess.

Initialize Foxit PDF 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 SDK can be called.
Once function Library::Release is called, Foxit PDF SDK library cannot be initialized any more in the life-cycle of the application.

Parameters

  [in] | sn | String of sn information, which can be retrieved from "SN=" part in key file "gsdk_sn.txt" or "rdk_sn.txt".
  [in] | key | String of key information, which can be retrieved from "Sign=" part in key file "gsdk_key.txt" or "rdk_key.txt".
  [in] | is_optimize_memory | The flag is used to attempt to optimize memory by cleaning up memory fragments. true means to clean up memory fragments, and false means not.
  [in] | enable_js_xfa_threadsafety | The flag is used to enable javascript and XFA module threadsafety. true means to enable, and false means not. Default value is false. Users need to ensure that one pdf document is only operated by one thread at a time.

Returns
  foxit::e_ErrSuccess means success.
  foxit::e_ErrInvalidLicense means input license information is invalid.
  foxit::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::e_ErrSuccess.

## ◆ MatchExternalFontsOnly()

static void foxit::common::Library::MatchExternalFontsOnly | ( | bool | only_match | ) |
| static

Specify whether to match fonts only from external fonts.

Parameters

  [in] | only_match | true means only match external fonts which are added by function Library::AddExternalFontPath. false means match system fonts when external fonts not found. Default value is false.

Returns
  None.

## ◆ Realloc()

static void* foxit::common::Library::Realloc | ( | void * | ptr,
|  | size_t | new_size
| ) |  |
| static

Reallocate a memory block.

If the param ptr is NULL, this function will allocate a new memory block.

Parameters

  [in] | ptr | Pointer to a memory block which is allocated by Library::Alloc and now is to be reallocated. NULL means this function will allocate a new memory block.
  [in] | new_size | New size of memory block in bytes.

Returns
  Pointer to a new reallocated memory block.

## ◆ RegisterSecurityCallback()

static bool foxit::common::Library::RegisterSecurityCallback | ( | const char * | filter,
|  | pdf::SecurityCallback * | callback
| ) |  |
| static

Register a pdf::SecurityCallback object to Foxit PDF SDK for decryption of the PDFs with special encryption filters.

When this function is successful, Foxit PDF SDK will take over the input security callback object and user should not release this callback object directly anymore; otherwise unexpected crash may occurs later.
Foxit PDF SDK may release the security callback object by callback function pdf::SecurityCallback::Release, when unregister it and find that it has not been used by other object. So, user is recommended not to use the security callback object any more after function Library::UnregisterSecurityCallback.

Parameters

  [in] | filter | The filter name of the security callback object. This should not be NULL or an empty string. When users implement security callback of pdf::CustomSecurityCallback, users could specified their own custom filter string, but need to follow the PDF name conventions. When users implement security callback of pdf::CertificateSecurityCallback, the filter value must be set to "Adobe.PubSec". When users implement security callback of pdf::DRMSecurityCallback, the filter value must be set to "FoxitDRM", or some error may occur later. When users implement security callback of pdf::RMSSecurityCallback, the filter value must be set to "MicrosoftIRMServices" or "FoxitRMS", or some error may occur later.
  [in] | callback | A pdf::SecurityCallback object, which is implemented by user and based on callback class pdf::SecurityCallback. User should not inherit pdf::SecurityCallback directly, but inherit its derived class, such as pdf::CustomSecurityCallback, pdf::CertificateSecurityCallback, etc.

Returns
  true means success, while false means failure.

Note
  If module "RMS" is not defined in the license information which is used in function Library::Initialize, that means user has no right in using RMS related functions and this function will throw exception foxit::e_ErrNoRMSModuleRight.

## ◆ RegisterSignatureCallback()

static bool foxit::common::Library::RegisterSignatureCallback | ( | const char * | filter,
|  | const char * | sub_filter,
|  | pdf::SignatureCallback * | signature_callback
| ) |  |
| static

Register a third-party pdf::SignatureCallback object to Foxit PDF SDK for signing and verifying signature, along with the filter and sub filter name of the callback.

Foxit PDF SDK has default signature callbacks defined with filter and sub filter:

- filter: "Adobe.PPKLite" and sub filter: "adbe.pkcs7.detached"
- filter: "Adobe.PPKLite" and sub filter: "adbe.pkcs7.sha1"
- filter: "Adobe.PPKLite" and sub filter: "ETSI.CAdES.detached"
- filter: "Adobe.PPKLite" and sub filter: "ETSI.RFC3161"

If user wants to use a third-party signature callback, please call this function before signing or verifying signature process.
If user register a customized signature callback with the same filter and sub filter as default ones by this function, and the value of parameter signature_callback is not NULL, the default signature callback in Foxit PDF SDK will not have effect. If user register a customized signature callback with the same filter and sub filter as default ones by this function, and the value of parameter signature_callback is NULL,
the default signature callback in Foxit PDF SDK will have effect again.

Parameters

  [in] | filter | The filter name of the signature callback, in ASCII encoding. This should not be an empty string. Filter name is the name of the signature callback.
  [in] | sub_filter | The sub filter name of the signature callback, in ASCII encoding. Sub filter is to describe the encoding of signature value and key information in the signature dictionary.
  [in] | signature_callback | A customized pdf::SignatureCallback object, which is implemented by user and based on callback class pdf::SignatureCallback. User should ensure all the callback functions have been implemented in application level and should also ensure this signature callback object valid until Foxit PDF SDK is released by function Library::Release. If this is NULL, that means the registered third-party callback is to be removed from Foxit PDF SDK.

Returns
  true means success, while false means failure.

## ◆ RegisterXFAAppProviderCallback()

static void foxit::common::Library::RegisterXFAAppProviderCallback | ( | addon::xfa::AppProviderCallback * | callback | ) |
| static

Register an addon::xfa::AppProviderCallback object to Foxit PDF SDK.

This function should be called first before processing XFA document.

Parameters

  [in] | callback | An addon::xfa::AppProviderCallback object, which is implemented by user and based on callback class addon::xfa::AppProviderCallback. User should ensure all the callback functions have been implemented in application level and should also ensure this XFA application provider callback object valid until Foxit PDF SDK is released by function Library::Release.

Returns
  None.

Note
  If module "XFA" is not defined in the license information which is used in function Library::Initialize, that means user has no right in using XFA related functions and this function will throw exception foxit::e_ErrNoXFAModuleRight.

## ◆ Reinitialize()

static ErrorCode foxit::common::Library::Reinitialize | ( |  | ) |
| static

Re-initialize Foxit PDF SDK Library.

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

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

## ◆ Release()

static void foxit::common::Library::Release | ( |  | ) |
| static

Release all resource allocated by Foxit PDF SDK Library.

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

Returns
  None.

## ◆ SetActionCallback()

static bool foxit::common::Library::SetActionCallback | ( | ActionCallback * | action_callback | ) |
| static

Set a foxit::ActionCallback object to Foxit PDF SDK, in aid of performing PDF actions.

User should implement an action callback object and call this function to set the action callback object to Foxit PDF SDK if PDF actions need to be performed, such as filling a PDF form.

Parameters

  [in] | action_callback | A customized foxit::ActionCallback object. NULL means not use any action callback object. User should ensure all the callback functions have been implemented in application level. If this is a valid action callback object, Foxit PDF SDK will take over the management of this callback object and user should not release it directly.

Returns
  true means success, while false means failure.

## ◆ SetAnnotIconProviderCallback()

static bool foxit::common::Library::SetAnnotIconProviderCallback | ( | pdf::annots::IconProviderCallback * | annot_icon_provider | ) |
| static

Set a customized pdf::annots::IconProviderCallback object to Foxit PDF SDK.

User can call this function to set a customized icon provider for annotation. If this function has been called several times, Foxit PDF SDK will only keep the last icon provider. If this function has not been called even once, Foxit PDF SDK will use the default standard icon provider.

Parameters

  [in] | annot_icon_provider | A customized annotation icon provider, which is implemented based on callback class pdf::annots::IconProviderCallback. If this is NULL, customized annotation icon provider will be removed from Foxit PDF SDK and default standard icon provider will be used instead. Application should ensure this icon provider object valid until it has been removed from Foxit PDF SDK or function Library::Release is called.

Returns
  true means success, while false means failure.

Note
  Icon provider's ID and version are treated as the name of the icon provider, so please offer different "ID + version" for different icon providers by callback functions pdf::annots::IconProviderCallback::GetProviderID and pdf::annots::IconProviderCallback::GetProviderVersion.

## ◆ SetCacheSize()

static bool foxit::common::Library::SetCacheSize | ( | uint32 | size | ) |
| static

Set the upper limit of PDF library cache size.

If no cache size limit is set by application, the cache size will be set to 200 MegaBytes internally by default.

Parameters

  [in] | size | The upper limit of the cache, in MegaBytes, 0~4096. If set to 0, that means not to use limit of cache size.

Returns
  true means success, while false means failure.

## ◆ SetDefaultICCProfilesPath()

static void foxit::common::Library::SetDefaultICCProfilesPath | ( | const wchar_t * | icc_profile_folder_path | ) |
| static

Set path of folder which contains default ICC profile files.

Default ICC profile files are offered in "res" folder Foxit PDF SDK package. Default ICC profile files are "sRGB Color Space Profile.icm", "sGray.icc", and "USWebCoatedSWOP.icc". Foxit PDF SDK will load these default ICC profile files from input folder path.
If input folder path does not exist or default ICC profile files are not all in the specified folder, this function will throw foxit::e_ErrFilePathNotExist.

Parameters

  [in] | icc_profile_folder_path | A valid path of a folder which contains default ICC profile files.

Returns
  None.

## ◆ SetDocEventCallback()

static bool foxit::common::Library::SetDocEventCallback | ( | DocEventCallback * | callback | ) |
| static

Set a DocEventCallback object to Foxit PDF SDK.

Parameters

  [in] | callback | A DocEventCallback object. NULL means not use any document event callback object.

Returns
  true means success, while false means failure.

## ◆ SetFontMapperCallback()

static bool foxit::common::Library::SetFontMapperCallback | ( | FontMapperCallback * | callback | ) |
| static

Set a FontMapperCallback object to Foxit PDF SDK.

Once a valid custom font mapper callback is set to Foxit PDF SDK, Foxit PDF SDK will first use this callback when mapping a font.

Parameters

  [in] | callback | A FontMapperCallback object. NULL means not use any custom font mapper callback object.

Returns
  true means success, while false means failure.

## ◆ SetLogFile() [1/3]

static void foxit::common::Library::SetLogFile | ( | const char * | log_file_path | ) |
| static

Set the log file path.

After a log file path is set to Foxit PDF SDK, all the logs will be written to the log file. Currently, the log information in Foxit PDF SDK is simple; this will be improved in future version.

Parameters

  [in] | log_file_path | A log file path.

Returns
  None.

## ◆ SetLogFile() [2/3]

static void foxit::common::Library::SetLogFile | ( | const wchar_t * | log_file_path | ) |
| static

Set the log file path.

After a log file path is set to Foxit PDF SDK, all the logs will be written to the log file. Currently, the log information in Foxit PDF SDK is simple; this will be improved in future version.

Parameters

  [in] | log_file_path | A log file path.

Returns
  None.

## ◆ SetLogFile() [3/3]

static void foxit::common::Library::SetLogFile | ( | foxit::common::file::StreamCallback * | log_file | ) |
| static

Set the log file stream.

After a log file is set to Foxit PDF SDK, all the logs will be written to the log file stream. Currently, the log information in Foxit PDF SDK is simple; this will be improved in future version.

Parameters

  [in] | log_file | A log file stream.

Returns
  None.

## ◆ SetNotifierCallback()

static bool foxit::common::Library::SetNotifierCallback | ( | NotifierCallback * | notifier | ) |
| static

Set a NotifierCallback object to Foxit PDF SDK.

User can call this function to set a notifier callback object to Foxit PDF SDK, so that when events (such as OOM) happens, user would be notified.

Parameters

  [in] | notifier | A NotifierCallback object. User should ensure all the callback functions have been implemented in application level.

Returns
  true means success, while false means failure.

## ◆ SetRenderConfig()

static void foxit::common::Library::SetRenderConfig | ( | const RenderConfig & | render_config | ) |
| static

Set the rendering configuration.

Parameters

  [in] | render_config | A rendering configuration object to be set.

Returns
  None.

## ◆ SetRenderTextGamma()

static void foxit::common::Library::SetRenderTextGamma | ( | float | gamma | ) |
| static

Set gamma value for text rendering.

If this function is not called to set gamma value, Foxit PDF SDK will use 2.2 as the default value.

Parameters

  [in] | gamma | Gamma value. It should be greater than 0.

Returns
  None.

## ◆ SetTimeStampCallback()

static bool foxit::common::Library::SetTimeStampCallback | ( | pdf::TimeStampCallback * | timestamp_callback | ) |
| static

Set a pdf::TimeStampCallback object to Foxit PDF SDK, in aid of interacting with time stamp server.

When this function is successful, Foxit PDF SDK will take over the default time stamp interaction during signing and user should not release this callback object directly anymore; otherwise unexpected crash may occurs later.
Foxit PDF SDK may release the time stamp callback object by callback function pdf::TimeStampCallback::Release, when timestamp_callback is NULL.

Parameters

  [in] | timestamp_callback | A customized pdf::TimeStampCallback object, which is implemented by user and based on callback class pdf::TimeStampCallback. User should ensure all the callback functions have been implemented in application level and should also ensure this time stamp callback object valid until Foxit PDF SDK is released by function Library::Release. If this is NULL, that means the registered third-party callback is to be removed from Foxit PDF SDK.

Returns
  true means success, while false means failure.

## ◆ UnregisterSecurityCallback()

static bool foxit::common::Library::UnregisterSecurityCallback | ( | const char * | filter | ) |
| static

Unregister a pdf::SecurityCallback object from Foxit PDF SDK.

Foxit PDF SDK may release the security callback function by callback function pdf::SecurityCallback::Release, when unregister it and find that it has not been used by other object. So, user is recommended not to use the security callback object any more after function Library::UnregisterSecurityCallback.

Parameters

  [in] | filter | The filter name which is used for registering a security callback object. Please refer to comment of parameter filter in function Library::RegisterSecurityCallback.

Returns
  true means success, while false means failure.

Note
  If module "RMS" is not defined in the license information which is used in function Library::Initialize, that means user has no right in using RMS related functions and this function will throw exception foxit::e_ErrNoRMSModuleRight.

## ◆ UnregisterSignatureCallback()

static void foxit::common::Library::UnregisterSignatureCallback | ( | const char * | filter,
|  | const char * | sub_filter
| ) |  |
| static

Unregister the third-party pdf::SignatureCallback object, which is associated with a specific filter and sub-filter, from the Foxit PDF SDK. If a default signature is available, it will be restored together with its filter and sub-filter values.

Foxit PDF SDK has default signature callbacks defined with filter and sub filter:

- filter: "Adobe.PPKLite" and sub filter: "adbe.pkcs7.detached"
- filter: "Adobe.PPKLite" and sub filter: "adbe.pkcs7.sha1"
- filter: "Adobe.PPKLite" and sub filter: "ETSI.CAdES.detached"
- filter: "Adobe.PPKLite" and sub filter: "ETSI.RFC3161"

Parameters

  [in] | filter | The filter name of the signature callback, in ASCII encoding. This should not be an empty string. Filter name is the name of the signature callback.
  [in] | sub_filter | The sub filter name of the signature callback, in ASCII encoding. Sub filter is to describe the encoding of signature value and key information in the signature dictionary.

Returns
  None.