Foxit PDF SDK
FSAction Class Reference
Inheritance diagram for FSAction:
FSBase FSEmbeddedGotoAction FSGotoAction FSHideAction FSImportDataAction FSJavaScriptAction FSLaunchAction FSNamedAction FSRemoteGotoAction FSRenditionAction FSResetFormAction FSSubmitFormAction FSURIAction

Instance Methods

(FSPDFDictionary *) - getDict
 Get PDF dictionary of current object.
More...
 
(FSPDFDoc *) - getDocument
 Get the PDF document, to which current action belongs.
More...
 
(FSAction *) - getSubAction:
 Get a sub-action by index.
More...
 
(int) - getSubActionCount
 Get the count of sub-actions.
More...
 
(FSActionType- getType
 Get action type.
More...
 
(id) - initWithAction:
 Constructor, with another action object.
More...
 
(id) - initWithDocument:action_dict:
 Constructor, with parameters.
More...
 
(void) - insertSubAction:sub_action:
 Insert a new sub-action to the location specified by index.
More...
 
(BOOL) - isEmpty
 Check whether current object is empty or not.
More...
 
(void) - removeAllSubActions
 Remove all the sub-actions.
More...
 
(void) - removeSubAction:
 Remove a sub-action, specified by index.
More...
 
(void) - setSubAction:sub_action:
 Set a sub-action by index.
More...
 

Class Methods

(FSAction *) + create:action_type:
 Create a new action, for specified action type.
More...
 

Detailed Description

PDF supports following standard action types:
"Go-To Action", "Remote Go-To Action", "Embedded Go-To Action", "Launch Action", "Thread Action", "URI Action", "Sound Action","Movie Action", "Hide Action", "Named Action", "Submit-Form Action", "Reset-Form Action", "Import-Data Action", "JavaScript Action", "Set-OCG-State Action", "Rendition Action","Transition Action","Go-To-3D-View Action".
A PDF action may have sub-actions. When this action is triggered, its sub-actions should also be triggered in turn.
Class FSAction is the base class for all kinds of PDF actions. For concrete action types, please refer to derived classes. Function FSAction::create:action_type: can be used to create a new action – currently only support some action types. Please refer to comment of this function for more details. This class also offers functions to modify sub-actions.

Method Documentation

◆ create:action_type:()

+ (FSAction *) create: (FSPDFDoc*)  document
action_type: (FSActionType action_type 

Create a new action, for specified action type.

The newly created action has no action data (except action type) yet. User needs to call the functions in concrete action classes to set action data.

Parameters
[in]documentA valid PDF document, to which the new action belongs.
[in]action_typeAction type, used to specify which type of action is to be created. Currently only support:
FSActionTypeGoto, FSActionTypeURI, FSActionTypeJavaScript, FSActionTypeNamed, FSActionTypeGoToR, FSActionTypeGoToE, FSActionTypeSubmitForm, FSActionTypeResetForm, FSActionTypeHide, FSActionTypeLaunch, FSActionTypeImportData, FSActionTypeRendition.
Returns
A new action object, with no action data.

◆ getDict()

- (FSPDFDictionary *) getDict

Get PDF dictionary of current object.

Returns
The PDF dictionary.If there is any error, this function will return nil.

◆ getDocument()

- (FSPDFDoc *) getDocument

Get the PDF document, to which current action belongs.

Returns
A PDF document object.

◆ getSubAction:()

- (FSAction *) getSubAction: (int)  index

Get a sub-action by index.

Parameters
[in]indexIndex of sub-action to be retrieved. Valid range: from 0 to (count-1). count is returned by function FSAction::getSubActionCount.
Returns
An action object that represents the specified sub-action.

◆ getSubActionCount()

- (int) getSubActionCount

Get the count of sub-actions.

Returns
Count of sub-actions.

◆ getType()

- (FSActionType) getType

Get action type.

Returns
Action type. Please refer to values starting from FSActionTypeGoto and this would be one of these values.

◆ initWithAction:()

- (id) initWithAction: (FSAction*)  action

Constructor, with another action object.

Parameters
[in]actionAnother action object.

Reimplemented in FSRenditionAction, FSLaunchAction, FSHideAction, FSImportDataAction, FSResetFormAction, FSSubmitFormAction, FSEmbeddedGotoAction, FSRemoteGotoAction, FSNamedAction, FSJavaScriptAction, FSURIAction, and FSGotoAction.

◆ initWithDocument:action_dict:()

- (id) initWithDocument: (FSPDFDoc*)  document
action_dict: (FSPDFDictionary*)  action_dict 

Constructor, with parameters.

Parameters
[in]documentA valid PDF document object.
[in]action_dictA PDF dictionary object that represents an action.

◆ insertSubAction:sub_action:()

- (void) insertSubAction: (int)  index
sub_action: (FSAction*)  sub_action 

Insert a new sub-action to the location specified by index.

Parameters
[in]indexIndex of the location, where the new sub-action is inserted.
If this index value is below zero, the new sub-action will be inserted to be the first.
If this index value equals or larger than current sub-action count, the new sub-action will be inserted to be the last.
[in]sub_actionNew sub-action to be inserted. Currently only support following types as the new sub-action:
FSActionTypeGoto, FSActionTypeURI, FSActionTypeJavaScript, FSActionTypeNamed, FSActionTypeGoToR, FSActionTypeGoToE, FSActionTypeSubmitForm, FSActionTypeResetForm, FSActionTypeHide, FSActionTypeLaunch, FSActionTypeImportData, FSActionTypeRendition.
Returns
None.

◆ isEmpty()

- (BOOL) isEmpty

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
YES means current object is empty, while NO means not.

◆ removeAllSubActions()

- (void) removeAllSubActions

Remove all the sub-actions.

Returns
None.

◆ removeSubAction:()

- (void) removeSubAction: (int)  index

Remove a sub-action, specified by index.

Parameters
[in]indexIndex of sub-action to be retrieved. Valid range: from 0 to (count-1). count is returned by function FSAction::getSubActionCount.
Returns
None.

◆ setSubAction:sub_action:()

- (void) setSubAction: (int)  index
sub_action: (FSAction*)  sub_action 

Set a sub-action by index.

Parameters
[in]indexIndex of sub-action to be retrieved. Valid range: from 0 to (count-1). count is returned by function FSAction::getSubActionCount.
[in]sub_actionAn action object to be set as a sub-action. Currently only support following types as sub-action:
FSActionTypeGoto, FSActionTypeURI, FSActionTypeJavaScript, FSActionTypeNamed, FSActionTypeGoToR, FSActionTypeGoToE, FSActionTypeSubmitForm, FSActionTypeResetForm, FSActionTypeHide, FSActionTypeLaunch, FSActionTypeImportData, FSActionTypeRendition.
Returns
None.