Foxit PDF SDK  9.1
<FSActionCallback> Protocol Reference
Inheritance diagram for <FSActionCallback>:

Instance Methods

(FSSearchIndexConfig *) - addSearchIndex:is_selected:
 A callback function to add a search index. More...
 
(int) - alert:title:type:icon:
 A callback function used to pop up a dialog to show warnings or hints. More...
 
(NSString *) - browseFile:file_format:file_filter:
 A callback function to show a file selection dialog. More...
 
(NSString *) - getAppInfo:
 A callback function to get application information. More...
 
(int) - getCurrentPage:
 A callback function used to receive current page index. More...
 
(BOOL) - getDocChangeMark:
 A callback function to receive the change mark which indicates whether the content of document is changed or not. More...
 
(FSIdentityProperties *) - getIdentityProperties
 A callback function used to get identity properties of current user. More...
 
(NSString *) - GetJapaneseEras:month:day:
 A callback function to get the Japanese ear name. More...
 
(FSRotation- getPageRotation:pageIndex:
 A callback function used to receive current displaying rotation of a page on PDF viewer. More...
 
(NSArray< NSString * > *) - getSignatureAPStyleNameList
 A callback function to get the name list of signature appearance style. More...
 
(BOOL) - invalidateRect:page_index:pdf_rect:
 A callback function to invalidate the client area within the specified rectangle. More...
 
(void) - query:search_scope:search_option:di_path:
 A callback function to query the text keywords. More...
 
(BOOL) - removeSearchIndex:
 (Reserved, unsupported yet) A callback function to remove a search index. More...
 
(void) - setCurrentPage:destination:
 A callback function used to set the current page by destination. More...
 
(void) - setCurrentPage:pageIndex:
 A callback function used to set the current page by index. More...
 
(BOOL) - setDocChangeMark:change_mark:
 A callback function to set the change mark which indicates whether the content of document is changed or not. More...
 
(BOOL) - setPageRotation:pageIndex:rotation:
 A callback function used to set the rotation value of a page on PDF viewer. More...
 
(BOOL) - submitForm:formData:url:file_format_type:
 A callback function to submit the form data to a specified URL. More...
 
(unsigned int) - verifySignature:signature:
 A callback function to verify specified signature.. More...
 

Detailed Description

This class represents a callback object for performing PDF actions. All the pure virtual functions in this class are used as callback functions and should be implemented by user, to perform PDF actions, such as javascript actions.

Method Documentation

◆ addSearchIndex:is_selected:

- (FSSearchIndexConfig *) addSearchIndex: (NSString *)  di_path
is_selected: (BOOL)  is_selected 
required

A callback function to add a search index.

This callback function will be triggered by the javascript method "search.addIndex". This callback function is optional, so it can be implemented to do nothing.

Parameters
[in]di_pathA device-independent path to an index file on the user's hard drive.
[in]is_selectedSpecifies whether the index should be selected for searching. Default value: true.
Returns
A SearchIndexConfig.

◆ alert:title:type:icon:

- (int) alert: (NSString *)  msg
title: (NSString *)  title
type: (int)  type
icon: (int)  icon 
required

A callback function used to pop up a dialog to show warnings or hints.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]msgThe message string to be displayed in the dialog.
[in]titleThe title of the dialog.
[in]typeType of button group. It would be one of following values:
  • 0: OK;(default value.)
  • 1: OK, Cancel;
  • 2: Yes, NO;
  • 3: Yes, NO, Cancel.
[in]iconIcon type. It would be one of following values:
  • 0: Error;(default value.)
  • 1: Warning;
  • 2: Question;
  • 3: Status.
Returns
The return value should be one of following values:
  • 1: OK;
  • 2: Cancel;
  • 3: NO;
  • 4: Yes;

◆ browseFile:file_format:file_filter:

- (NSString *) browseFile: (BOOL)  is_open_dialog
file_format: (NSString *)  file_format
file_filter: (NSString *)  file_filter 
required

A callback function to show a file selection dialog.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]is_open_dialogA boolean value to specify whether the dialog is for opening file or saving file. true means the dialog should be used to open file, while false means the dialog should be used to save file.
[in]file_formatThe file format string.
[in]file_filterThe file filter string.
Returns
The file path. It can be an empty string.

◆ getAppInfo:

- (NSString *) getAppInfo: (FSActionCallbackAppInfoType)  type
required

A callback function to get application information.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.
For the digital information like ActionCallback::e_AppInfoTypeViewerVersion, ActionCallback::e_AppInfoTypeAppVersion and ActionCallback::e_AppInfoTypeFormsVersion, please use string to represent it.

Parameters
[in]typeType of information. Please refer to values starting from ActionCallback::e_AppInfoTypeFormsVersion and this would be one of these values.
Returns
The application information.

◆ getCurrentPage:

- (int) getCurrentPage: (FSPDFDoc *)  pdfDoc
required

A callback function used to receive current page index.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]pdfDocA PDF document object. It would be valid.
Returns
Current page index. The value should be stared from 0 and less than page count of the specified document.

◆ getDocChangeMark:

- (BOOL) getDocChangeMark: (FSPDFDoc *)  document
required

A callback function to receive the change mark which indicates whether the content of document is changed or not.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]documentA PDF document object. It would be valid.
Returns
YES means the PDF document is changed, while NO means not.

◆ getIdentityProperties

- (FSIdentityProperties*) getIdentityProperties
required

A callback function used to get identity properties of current user.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Returns
An identity properties object that specifies the identity properties of current user.

◆ GetJapaneseEras:month:day:

- (NSString *) GetJapaneseEras: (int)  year
month: (int)  month
day: (int)  day 
required

A callback function to get the Japanese ear name.

This callback function will be triggered by the javascript method “AnnotActionHandler.GetJapaneseEras". This callback function is optional, so it can be implemented to do nothing.

Parameters
[in]yearDesignated year.
[in]monthDesignated month.
[in]dayDesignated day.
Returns
The Japanese ear name.

◆ getPageRotation:pageIndex:

- (FSRotation) getPageRotation: (FSPDFDoc *)  pdfDoc
pageIndex: (int)  pageIndex 
required

A callback function used to receive current displaying rotation of a page on PDF viewer.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]pdfDocA PDF document object. It would be valid.
[in]pageIndexA page index, used to specify which page's rotation is to be retrieved. The index would start from 0 and less than page count of the specified document.
Returns
The rotation of specified page. Please refer to values starting from FSRotation0 and this should be one of these values.

◆ getSignatureAPStyleNameList

- (NSArray<NSString *> *) getSignatureAPStyleNameList
required

A callback function to get the name list of signature appearance style.

This callback function will be triggered by the javascript method "SecurityHandler.appearances". This callback function is optional, so it can be implemented to do nothing.

Returns
An array of signature appearance style name.

◆ invalidateRect:page_index:pdf_rect:

- (BOOL) invalidateRect: (FSPDFDoc *)  document
page_index: (int)  page_index
pdf_rect: (FSRectF *)  pdf_rect 
required

A callback function to invalidate the client area within the specified rectangle.

All positions are measured in PDF "user space". Implementation should call function common::Renderer::StartRender for repainting a specified page area.

Parameters
[in]documentA PDF document object. It would be valid.
[in]page_indexA page index. It would start from 0 and less than page count of the specified document.
[in]pdf_rectA rectangle that specifies the page area in PDF coordinate system. If this is an empty rectangle, that means to refresh the whole page.
Returns
true means success, while false means failure.

◆ query:search_scope:search_option:di_path:

- (void) query: (NSString *)  keywords
search_scope: (FSActionCallbackSearchScope)  search_scope
search_option: (FSSearchOption *)  search_option
di_path: (NSString *)  di_path 
required

A callback function to query the text keywords.

This callback function will be triggered by the javascript method "search.query". This callback function is optional, so it can be implemented to do nothing.

Parameters
[in]keywordsThe text content for which to search.
[in]search_scopeSpecifies where the text should be searched. Please refer to values starting from ActionCallback::e_SearchScopeActiveDoc and this should be one of these values.
[in]search_optionA SearchOption object that represents search option.
[in]di_pathA device-independent path to a folder or search index on the user's computer. This parameter is optional. When search_scope is ActionCallback::e_SearchScopeFolder or ActionCallback::e_SearchScopeIndex, this parameter is required.
Returns
None.

◆ removeSearchIndex:

- (BOOL) removeSearchIndex: (FSSearchIndexConfig *)  searchIndexConfig
required

(Reserved, unsupported yet) A callback function to remove a search index.

This callback function will be triggered by the javascript method "search.removeIndex". This callback function is optional, so it can be implemented to do nothing.

Parameters
[in]search_index_configA SearchIndexConfig that represents the search index config.
Returns
true means success, while false means failure.

◆ setCurrentPage:destination:

- (void) setCurrentPage: (FSPDFDoc *)  pdfDoc
destination: (FSDestination *)  destination 
required

A callback function used to set the current page by destination.

This callback function is optional, so it can be implemented to do nothing.

Parameters
[in]documentA PDF document object. It would be valid.
[in]destinationA object. None.

◆ setCurrentPage:pageIndex:

- (void) setCurrentPage: (FSPDFDoc *)  pdfDoc
pageIndex: (int)  pageIndex 
required

A callback function used to set the current page by index.

This callback function is optional, so it can be implemented to do nothing.

Parameters
[in]pdfDocA PDF document object. It would be valid.
[in]pageIndexA page index which is used to change current page. The index would start from 0 and less than page count of the specified document.
Returns
None.

◆ setDocChangeMark:change_mark:

- (BOOL) setDocChangeMark: (FSPDFDoc *)  document
change_mark: (BOOL)  change_mark 
required

A callback function to set the change mark which indicates whether the content of document is changed or not.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]documentA PDF document object. It would be valid.
[in]change_markA boolean value that indicates whether the content of document is changed or not.
Returns
YES means success, while NO means failure.

◆ setPageRotation:pageIndex:rotation:

- (BOOL) setPageRotation: (FSPDFDoc *)  pdfDoc
pageIndex: (int)  pageIndex
rotation: (FSRotation rotation 
required

A callback function used to set the rotation value of a page on PDF viewer.

This callback function is optional, so it can be implemented to do nothing.

Parameters
[in]pdfDocA PDF document object. It would be valid.
[in]pageIndexA page index, used to specify which page's rotation is to be changed. The index would start from 0 and less than page count of the specified document.
[in]rotationNew rotation value. Please refer to values starting from FSRotation0 and this would be one of these values except FSRotationUnknown.
Returns
YES means success, while NO means failure.

◆ submitForm:formData:url:file_format_type:

- (BOOL) submitForm: (FSPDFDoc *)  document
formData: (NSData *)  formData
url: (NSString *)  url
file_format_type: (FSFileFormatType file_format_type 
required

A callback function to submit the form data to a specified URL.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]documentA PDF document object. It would be valid.
[in]form_dataA form data buffer which is to be submitted.
[in]lengthThe size (in bytes) of the buffer parameterform_data.
[in]urlA URL, to which the form data will be submitted.
[in]file_format_typeFile format type for submission form. Please refer to values starting from foxit::common::e_FileFormatTypeFDF and this would be one of these values.
Returns
true means success, while false means failure.

◆ verifySignature:signature:

- (unsigned int) verifySignature: (FSPDFDoc *)  document
signature: (FSSignature *)  signature 
required

A callback function to verify specified signature..

This callback function will be triggered when a signature is to be verified by an action. If user does not want to verify the signature, just implement this function to do nothing and just return pdf::Signature::e_StateUnknown. User is recommended to use class pdf::LTVVerifier to verify if a signed signature is valid or not.

Parameters
[in]documentA PDF document object. It would be valid.
[in]signatureA PDF signature which is signed. This signature belongs to input paramter document.
Returns
The signature verified state. Please refer to values starting from Signature::e_StateUnknown and this would be one or combination of them.