Foxit PDF SDK
|
Inherits FoxitPDFSDKPython2._object.
Static Public Member Functions | |
def | EnableJavaScript (enable_javascript) |
Enable or disable javascript for PDF. More... | |
def | EnableThreadSafety (is_enable_thread_safety) |
Enable thread safety. More... | |
def | GetRenderConfig () |
Get the rendering configuration. More... | |
def | GetVersion () |
Get the version of current Foxit PDF SDK library. More... | |
def | HasModuleLicenseRight (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... | |
def | Initialize () |
Initialize Foxit PDF SDK Library, with valid license information. More... | |
def | RegisterSecurityCallback (filter, callback) |
Register a FoxitPDFSDKPython2.SecurityCallback object to Foxit PDF SDK for decryption of the PDFs with special encryption filters. More... | |
def | RegisterSignatureCallback (filter, sub_filter, signature_callback) |
Register a third-party FoxitPDFSDKPython2.SignatureCallback object to Foxit PDF SDK for signing and verifying signature, along with the filter and sub filter name of the callback. More... | |
def | RegisterXFAAppProviderCallback (callback) |
Register an FoxitPDFSDKPython2.AppProviderCallback object to Foxit PDF SDK. More... | |
def | Reinitialize () |
Re-initialize Foxit PDF SDK Library. More... | |
def | Release () |
Release all resource allocated by Foxit PDF SDK Library. More... | |
def | SetActionCallback (action_callback) |
Set a FoxitPDFSDKPython2.ActionCallback object to Foxit PDF SDK, in aid of performing PDF actions. More... | |
def | SetAnnotIconProviderCallback (annot_icon_provider) |
Set a customized FoxitPDFSDKPython2.IconProviderCallback object to Foxit PDF SDK. More... | |
def | SetCacheSize (size) |
Set the upper limit of PDF library cache size. More... | |
def | SetDefaultICCProfilesPath (icc_profile_folder_path) |
Set path of folder which contains default ICC profile files. More... | |
def | SetDocEventCallback (callback) |
Set a DocEventCallback object to Foxit PDF SDK. More... | |
def | SetFontMapperCallback (callback) |
Set a FontMapperCallback object to Foxit PDF SDK. More... | |
def | SetLogFile (log_file_path) |
Set the log file path. More... | |
def | SetNotifierCallback (notifier) |
Set a NotifierCallback object to Foxit PDF SDK. More... | |
def | SetRenderConfig (render_config) |
Set the rendering configuration. More... | |
def | SetRenderTextGamma (gamma) |
Set gamma value for text rendering. More... | |
def | SetTimeStampCallback (timestamp_callback) |
Set a FoxitPDFSDKPython2.TimeStampCallback object to Foxit PDF SDK, in aid of interacting with time stamp server. More... | |
def | UnregisterSecurityCallback (filter) |
Unregister a FoxitPDFSDKPython2.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 FoxitPDFSDKPython2.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 FoxitPDFSDKPython2.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 FoxitPDFSDKPython2.e_ErrFile to know more about what error occurs.
|
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 |
Enable thread safety.
Currently, module "OCR" does not support thread safety.
[in] | is_enable_thread_safety | Enable thread safety.true means to enable thread safety, while false means to disable thread safety. |
|
static |
Get the rendering configuration.
|
static |
Get the version of current Foxit PDF SDK library.
|
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.
[in] | module_name | Name of the module whose right is to be checked. Please refer to values starting from FoxitPDFSDKPython2.e_ModuleNameConnectedPDF and this should be one of these values. |
|
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 FoxitPDFSDKPython2.Library.Release is called, Foxit PDF SDK library cannot be initialized any more in the life-cycle of the application.
[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". |
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 FoxitPDFSDKPython2.Library.Release is called, Foxit PDF SDK library cannot be initialized any more in the life-cycle of the application.
[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. |
|
static |
Register a FoxitPDFSDKPython2.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 FoxitPDFSDKPython2.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 FoxitPDFSDKPython2.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 FoxitPDFSDKPython2.CustomSecurityCallback , users could specified their own custom filter string, but need to follow the PDF name conventions. When users implement security callback of FoxitPDFSDKPython2.CertificateSecurityCallback , the filter value must be set to "Adobe.PubSec". When users implement security callback of FoxitPDFSDKPython2.DRMSecurityCallback , the filter value must be set to "FoxitDRM", or some error may occur later. When users implement security callback of FoxitPDFSDKPython2.RMSSecurityCallback , the filter value must be set to "MicrosoftIRMServices" or "FoxitRMS", or some error may occur later. |
[in] | callback | A FoxitPDFSDKPython2.SecurityCallback object, which is implemented by user and based on callback class FoxitPDFSDKPython2.SecurityCallback . User should not inherit FoxitPDFSDKPython2.SecurityCallback directly, but inherit its derived class, such as FoxitPDFSDKPython2.CustomSecurityCallback , FoxitPDFSDKPython2.CertificateSecurityCallback , etc. |
|
static |
Register a third-party FoxitPDFSDKPython2.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 sub filter as default ones by this function, and the value of parameter 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 is null,
the default signature callback in Foxit PDF SDK will have effect again.
[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 FoxitPDFSDKPython2.SignatureCallback object, which is implemented by user and based on callback class FoxitPDFSDKPython2.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 FoxitPDFSDKPython2.Library.Release . If this is null, that means the registered third-party callback is to be removed from Foxit PDF SDK. |
|
static |
Register an FoxitPDFSDKPython2.AppProviderCallback object to Foxit PDF SDK.
This function should be called first before processing XFA document.
[in] | callback | An FoxitPDFSDKPython2.AppProviderCallback object, which is implemented by user and based on callback class FoxitPDFSDKPython2.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 FoxitPDFSDKPython2.Library.Release . |
|
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 FoxitPDFSDKPython2.Library.Release is called, user can call this function to re-initialize Foxit PDF SDK Library.
Once function FoxitPDFSDKPython2.Library.Release is called, Foxit PDF SDK library cannot be initialized any more in the life-cycle of the application.
|
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.
|
static |
Set a FoxitPDFSDKPython2.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 FoxitPDFSDKPython2.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 FoxitPDFSDKPython2.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 FoxitPDFSDKPython2.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 FoxitPDFSDKPython2.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 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 FoxitPDFSDKPython2.e_ErrFilePathNotExist .
[in] | icc_profile_folder_path | A valid path of a folder which contains default ICC profile files. |
|
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 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.
[in] | callback | A FontMapperCallback object. null means not use any custom font mapper 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 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 the rendering configuration.
[in] | render_config | A rendering configuration object to be set. |
|
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 |
Set a FoxitPDFSDKPython2.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 FoxitPDFSDKPython2.TimeStampCallback.Release , when timestamp_callback is null.
[in] | timestamp_callback | A customized FoxitPDFSDKPython2.TimeStampCallback object, which is implemented by user and based on callback class FoxitPDFSDKPython2.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 FoxitPDFSDKPython2.Library.Release . If this is null, that means the registered third-party callback is to be removed from Foxit PDF SDK. |
|
static |
Unregister a FoxitPDFSDKPython2.SecurityCallback object from Foxit PDF SDK.
Foxit PDF SDK may release the security callback function by callback function FoxitPDFSDKPython2.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 FoxitPDFSDKPython2.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 FoxitPDFSDKPython2.Library.RegisterSecurityCallback . |