Foxit PDF SDK
|
Inherits NSObject.
Class Methods | |
(void) | + destroy |
Release all resource allocated by Foxit PDF SDK Library. More... | |
(BOOL) | + enableJavaScript: |
Enable or disable javascript for PDF. More... | |
(NSString *) | + getVersion |
Get the version of current Foxit PDF SDK library. More... | |
(FSErrorCode) | + initialize:key: |
Initialize Foxit PDF SDK Library, with valid license information. More... | |
(BOOL) | + registerSecurityCallback:callback: |
Register a FSSecurityCallback object to Foxit PDF SDK for decryption of the PDFs with special encryption filters. More... | |
(BOOL) | + registerSignatureCallback:sub_filter:signature_callback: |
Register a third-party FSSignatureCallback object to Foxit PDF SDK for signing and verifying signature, along with the filter and sub filter name of the callback. More... | |
(void) | + registerXFAAppProviderCallback: |
Register an FSAppProviderCallback object to Foxit PDF SDK. More... | |
(FSErrorCode) | + reinitialize |
Reinitialize Foxit PDF SDK Library. More... | |
(BOOL) | + setActionCallback: |
Set a FSActionCallback object to Foxit PDF SDK, in aid of performing PDF actions. More... | |
(BOOL) | + setAnnotIconProviderCallback: |
Set a customized FSIconProviderCallback object to Foxit PDF SDK. More... | |
(BOOL) | + setCacheSize: |
Set the upper limit of PDF library cache size. More... | |
(BOOL) | + setDocEventCallback: |
Set a object to Foxit PDF SDK. More... | |
(void) | + setLogFile: |
Set the log file path. More... | |
(BOOL) | + setNotifierCallback: |
Set a object to Foxit PDF SDK. More... | |
(void) | + setRenderTextGamma: |
Set gamma value for text rendering. More... | |
(BOOL) | + unregisterSecurityCallback: |
Unregister a FSSecurityCallback 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 FSLibrary::initialize:key: before calling any other Foxit PDF SDK functions. When there is no need to use Foxit PDF SDK any more, please call function FSLibrary::destroy. 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 FSErrFile to know more about what error occurs.
+ (void) destroy |
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 FSLibrary::initialize:key: again.
+ (BOOL) enableJavaScript: | (BOOL) | enable_javascript |
Enable or disable javascript for PDF.
Javascript for PDF is enabled by default.
[in] | enable_javascript | YES means to enable javascript, and NO means to disable javascript. If this function is not called, javascript for PDF is enabled by default. |
+ (NSString *) getVersion |
Get the version of current Foxit PDF SDK library.
+ (FSErrorCode) initialize: | (NSString *) | sn | |
key: | (NSString *) | key | |
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". |
+ (BOOL) registerSecurityCallback: | (NSString *) | filter | |
callback: | (id<FSSecurityCallback>) | callback | |
Register a FSSecurityCallback 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.
[in] | filter | The filter name of the security callback object. This should not be nil or an empty string. When users implement security callback of FSCustomSecurityCallback, users could specified their own custom filter string, but need to follow the PDF name conventions. When users implement security callback of FSCertificateSecurityCallback, the filter value must be set to "Adobe.PubSec". When users implement security callback of FSDRMSecurityCallback, the filter value must be set to "FoxitDRM", or some error may occur later. When users implement security callback of FSRMSSecurityCallback, the filter value must be set to "MicrosoftIRMServices", or some error may occur later. |
[in] | callback | A FSSecurityCallback object, which is implemented by user and based on callback class FSSecurityCallback. User should not inherit FSSecurityCallback directly, but inherit its derived class, such as FSCustomSecurityCallback, FSCertificateSecurityCallback, etc. |
+ (BOOL) registerSignatureCallback: | (NSString *) | filter | |
sub_filter: | (NSString *) | sub_filter | |
signature_callback: | (id<FSSignatureCallback>) | signature_callback | |
Register a third-party FSSignatureCallback 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 FSSignatureCallback object, which is implemented by user and based on callback class FSSignatureCallback. 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 FSLibrary::destroy. If this is nil, that means the registered third-party callback is to be removed from Foxit PDF SDK. |
+ (void) registerXFAAppProviderCallback: | (id<FSAppProviderCallback>) | callback |
Register an FSAppProviderCallback object to Foxit PDF SDK.
This function should be called first before processing XFA document.
[in] | callback | An FSAppProviderCallback object, which is implemented by user and based on callback class FSAppProviderCallback. 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 FSLibrary::destroy. |
+ (FSErrorCode) reinitialize |
Reinitialize Foxit PDF SDK Library.
When user meets out-of-memory error, user can call this function to reinitialize Foxit PDF SDK Library.
+ (BOOL) setActionCallback: | (id<FSActionCallback>) | action_callback |
Set a FSActionCallback 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 FSActionCallback object. nil 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. |
+ (BOOL) setAnnotIconProviderCallback: | (id<FSIconProviderCallback>) | annot_icon_provider |
Set a customized FSIconProviderCallback 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 FSIconProviderCallback. If this is nil, 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 FSLibrary::destroy is called. |
+ (BOOL) setCacheSize: | (unsigned int) | size |
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. |
+ (BOOL) setDocEventCallback: | (id<FSDocEventCallback>) | callback |
Set a object to Foxit PDF SDK.
[in] | callback | A object. nil means not use any document event callback object. |
+ (void) setLogFile: | (NSString *) | log_file_path |
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. |
+ (BOOL) setNotifierCallback: | (id<FSNotifierCallback>) | notifier |
Set a 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 object. User should ensure all the callback functions have been implemented in application level. |
+ (void) setRenderTextGamma: | (float) | gamma |
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. |
+ (BOOL) unregisterSecurityCallback: | (NSString *) | filter |
Unregister a FSSecurityCallback object from Foxit PDF SDK.
[in] | filter | The filter name which is used for registering a security callback object. Please refer to comment of parameter filter in function FSLibrary::registerSecurityCallback:callback:. |