Foxit PDF SDK

Instance Methods | List of all members
FSAdditionalAction Class Reference

Unknown language.
More...

Inheritance diagram for FSAdditionalAction:

## Instance Methods
(BOOL) | - doJSAction:
| Perform javascript action which is specified by a trigger event type. More...
(FSAction *) | - getAction:
| Get an action with specified trigger event type. More...
(FSPDFDictionary *) | - getDict
| Get the PDF dictionary of current object. More...
(id) | - initWithAnnot:
| Constructor, from a PDF annotation. More...
(id) | - initWithDoc:pdf_dict:
| Constructor, from a PDF document or a PDF dictionary (if any). More...
(id) | - initWithField:
| Constructor, from a PDF form field. More...
(id) | - initWithOther:
| Constructor, with another additional action object. More...
(id) | - initWithPage:
| Constructor, from a PDF page. More...
(BOOL) | - isEmpty
| Check whether current object is empty or not. More...
(BOOL) | - removeAction:
| Remove an action with specified trigger event type. More...
(BOOL) | - removeAllActions
| Remove all actions. More...
(void) | - setAction:action:
| Set a additional-action for specified trigger event type. More...

## Detailed Description

Unknown language.

Chinese Simplified.

Chinese Traditional.

Danish.

German.

English.

Spanish.

French.

Italian.

Korean.

Japanese.

Dutch.

Norwegian.

Brazilian Portuguese.

Finnish.

Swedish.

An annotation, page object, or (beginning with PDF 1.3) interactive form field may include an entry named "AA" which specifies an additional-actions dictionary (PDF 1.2) that extends the set of events that can trigger the execution of an action. In PDF 1.4, the document catalog dictionary may also contain an "AA" entry for trigger events affecting the document as a whole.
This class can be constructed from PDF document, PDF page, PDF form field, PDF annotation (only some types) or an existing additional-actions dictionary and can be used to get/set data from an additional-actions dictionary from PDF document, PDF page, PDF form field or PDF annotation.

## Method Documentation

## ◆ doJSAction:()

- (BOOL) doJSAction: |  | (FSAdditionalActionTriggerEvent) | trigger |

Perform javascript action which is specified by a trigger event type.

If current object is constructed with a valid PDF dictionary, current function will return NO directly because Foxit PDF SDK cannot know which kind of object the additional action dictionary is associated with.

Parameters

  [in] | trigger | The input trigger event type. It should be: If current additional-action is constructed from PDF page, the trigger value must be one of values starting from FSAdditionalActionTriggerPageOpened (with same prefix name). If current additional-action is constructed from PDF document, the trigger value must be one of values starting from FSAdditionalActionTriggerDocWillClose (with same prefix name). If current additional-action is constructed from PDF form field, the trigger value must be one of values starting from FSAdditionalActionTriggerFieldKeyStroke (with same prefix name). If current additional-action is constructed from PDF annotation, the trigger value must be one of values starting from FSAdditionalActionTriggerAnnotCursorEnter (with same prefix name).

Returns
  YES means success , while NO means failure or current object is constructed from PDF dictionary.

## ◆ getAction:()

- (FSAction *) getAction: |  | (FSAdditionalActionTriggerEvent) | trigger |

Get an action with specified trigger event type.

Parameters

  [in] | trigger | The input trigger event type. It should be: If current additional-action is constructed from PDF dictionary, the trigger value can be one of values defined in enum class TriggerEvent. If current additional-action is constructed from PDF page, the trigger value must be one of values starting from FSAdditionalActionTriggerPageOpened (with same prefix name). If current additional-action is constructed from PDF document, the trigger value must be one of values starting from FSAdditionalActionTriggerDocWillClose (with same prefix name). If current additional-action is constructed from PDF form field, the trigger value must be one of values starting from FSAdditionalActionTriggerFieldKeyStroke (with same prefix name). If current additional-action is constructed from PDF annotation, the trigger value must be one of values starting from FSAdditionalActionTriggerAnnotCursorEnter (with same prefix name).

Returns
  An action object.

## ◆ getDict()

- (FSPDFDictionary *) getDict |  |  |

Get the PDF dictionary of current object.

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

## ◆ initWithAnnot:()

- (id) initWithAnnot: |  | (FSAnnot*) | annot |

Constructor, from a PDF annotation.

Parameters

  [in] | annot | A valid PDF annotation. Currently, only support widget and screen annotation. For other types of annotations, this function will throw exception FSErrUnsupported.

## ◆ initWithDoc:pdf_dict:()

- (id) initWithDoc: |  | (FSPDFDoc*) | doc
pdf_dict: |  | (FSPDFDictionary*) | pdf_dict

Constructor, from a PDF document or a PDF dictionary (if any).

Parameters

  [in] | doc | A valid PDF document object.
  [in] | pdf_dict | A PDF dictionary which represents an additional action dictionary. If this parameter is nil, that means just to construct an Additional action object with PDF document. If this parameter is not nil, that means to construct an Additional action object from this PDF dictionary should have existed in the specified PDF document and represents the additional action dictionary. Default value: nil.

## ◆ initWithField:()

- (id) initWithField: |  | (FSField*) | field |

Constructor, from a PDF form field.

Parameters

  [in] | field | A valid PDF form field.

## ◆ initWithOther:()

- (id) initWithOther: |  | (FSAdditionalAction*) | other |

Constructor, with another additional action object.

Parameters

  [in] | other | Another additional action object.

## ◆ initWithPage:()

- (id) initWithPage: |  | (FSPDFPage*) | page |

Constructor, from a PDF page.

Parameters

  [in] | page | A valid PDF page object.

## ◆ 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.

## ◆ removeAction:()

- (BOOL) removeAction: |  | (FSAdditionalActionTriggerEvent) | trigger |

Remove an action with specified trigger event type.

If there is no action for input trigger event type when it is valid, this function will return YES directly.

Parameters

  [in] | trigger | The input trigger event type. It should be: If current additional-action is constructed from PDF dictionary, the trigger value can be one of values defined in enum class TriggerEvent. If current additional-action is constructed from PDF page, the trigger value must be one of values starting from FSAdditionalActionTriggerPageOpened (with same prefix name). If current additional-action is constructed from PDF document, the trigger value must be one of values starting from FSAdditionalActionTriggerDocWillClose (with same prefix name). If current additional-action is constructed from PDF form field, the trigger value must be one of values starting from FSAdditionalActionTriggerFieldKeyStroke (with same prefix name). If current additional-action is constructed from PDF annotation, the trigger value must be one of values starting from FSAdditionalActionTriggerAnnotCursorEnter (with same prefix name).

Returns
  YES means success , while NO means failure.

## ◆ removeAllActions()

- (BOOL) removeAllActions |  |  |

Remove all actions.

Returns
  YES means success , while NO means failure.

## ◆ setAction:action:()

- (void) setAction: |  | (FSAdditionalActionTriggerEvent) | trigger
action: |  | (FSAction*) | action

Set a additional-action for specified trigger event type.

Parameters

  [in] | trigger | The input trigger event type. It should be: If current additional-action is constructed from PDF dictionary, the trigger value can be one of values defined in enum class TriggerEvent. If current additional-action is constructed from PDF page, the trigger value must be one of values starting from FSAdditionalActionTriggerPageOpened (with same prefix name). If current additional-action is constructed from PDF document, the trigger value must be one of values starting from FSAdditionalActionTriggerDocWillClose (with same prefix name). If current additional-action is constructed from PDF form field, the trigger value must be one of values starting from FSAdditionalActionTriggerFieldKeyStroke (with same prefix name). If current additional-action is constructed from PDF annotation, the trigger value must be one of values starting from FSAdditionalActionTriggerAnnotCursorEnter (with same prefix name).
  [in] | action | An action object to be set. If current additional-action is constructed from PDF document or PDF form field, the type of this action should be FSActionTypeJavaScript. If current additional-action is constructed from PDF page, PDF annotation, or PDF dictionary, please refer to comment of the trigger event to check if only specified type of action can be used. Usually, support following types as the new action: FSActionTypeGoto, FSActionTypeURI, FSActionTypeJavaScript, FSActionTypeNamed, FSActionTypeGoToR, FSActionTypeGoToE, FSActionTypeSubmitForm, FSActionTypeResetForm, FSActionTypeHide, FSActionTypeLaunch, FSActionTypeImportData, FSActionTypeRendition.

Returns
  None.