Inherits Object.
Static Public Member Functions | |
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 | Free (void *ptr) |
Free a memory block. More... | |
static String | GetVersion () |
Get the version of current Foxit PDF SDK library. More... | |
static ErrorCode | Initialize (const char *sn, const char *key) |
Initialize Foxit PDF SDK Library, with valid license information. 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 () |
Reinitialize 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 bool | SetDocEventCallback (DocEventCallback *callback) |
Set a DocEventCallback 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 bool | SetNotifierCallback (NotifierCallback *notifier) |
Set a NotifierCallback object to Foxit PDF SDK. More... | |
static void | SetRenderTextGamma (float gamma) |
Set gamma value for text rendering. More... | |
static bool | UnregisterSecurityCallback (const char *filter) |
Unregister a pdf::SecurityCallback object from Foxit PDF SDK. More... | |
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.
|
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.
[in] | size | The number of bytes to be allocated. |
|
static |
Enable or disable javascript for PDF.
Javascript for PDF is enabled by default.
[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. |
|
static |
Free a memory block.
[in] | ptr | Pointer to a memory block allocated by function Library::Alloc to be released. |
|
static |
Get the version of current Foxit PDF SDK library.
|
static |
Initialize Foxit PDF SDK Library, with valid license information.
This function should be called first before any other functions in Foxit PDF SDK can be called.
[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". |
|
static |
Reallocate a memory block.
If the param ptr is NULL, this function will allocate a new memory block.
[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. |
|
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.
[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 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. |
|
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:
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 filter as default ones by this function, the default signature callback in Foxit PDF SDK will not have any effect any more.
[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. |
|
static |
Register an addon::xfa::AppProviderCallback object to Foxit PDF SDK.
This function should be called first before processing XFA document.
[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. |
|
static |
Reinitialize Foxit PDF SDK Library.
When user meets out-of-memory error, user can call this function to reinitialize Foxit PDF SDK Library.
|
static |
Release all resource allocated by Foxit PDF SDK Library.
User can call this function to release all memory blocks allocated by the library. After this function is called, user should not use Foxit PDF SDK any more until call Library::Initialize again.
|
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.
[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. |
|
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.
[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. |
|
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.
[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. |
|
static |
Set a DocEventCallback object to Foxit PDF SDK.
[in] | callback | A DocEventCallback object. NULL means not use any document event callback object. |
|
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.
[in] | log_file_path | A 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.
[in] | log_file_path | A log file path. |
|
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.
[in] | notifier | A NotifierCallback object. User should ensure all the callback functions have been implemented in application level. |
|
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.
[in] | gamma | Gamma value. It should be greater than 0. |
|
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.
[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. |