Foxit PDF SDK
foxit.pdf.actions.Action Class Reference
Inheritance diagram for foxit.pdf.actions.Action:
foxit.common.Base foxit.pdf.actions.EmbeddedGotoAction foxit.pdf.actions.GotoAction foxit.pdf.actions.HideAction foxit.pdf.actions.ImportDataAction foxit.pdf.actions.JavaScriptAction foxit.pdf.actions.LaunchAction foxit.pdf.actions.NamedAction foxit.pdf.actions.RemoteGotoAction foxit.pdf.actions.RenditionAction foxit.pdf.actions.ResetFormAction foxit.pdf.actions.SubmitFormAction foxit.pdf.actions.URIAction

Public Types

enum  NewWindowFlag { NewWindowFlag.e_NewWindowFlagFalse = 0, NewWindowFlag.e_NewWindowFlagTrue = 1, NewWindowFlag.e_NewWindowFlagNone = 2 }
 Enumeration for new window flag.
More...
 
enum  Type {
  Type.e_TypeUnknown = 0, Type.e_TypeGoto = 1, Type.e_TypeGoToR = 2, Type.e_TypeGoToE = 3,
  Type.e_TypeLaunch = 4, Type.e_TypeThread = 5, Type.e_TypeURI = 6, Type.e_TypeSound = 7,
  Type.e_TypeMovie = 8, Type.e_TypeHide = 9, Type.e_TypeNamed = 10, Type.e_TypeSubmitForm = 11,
  Type.e_TypeResetForm = 12, Type.e_TypeImportData = 13, Type.e_TypeJavaScript = 14, Type.e_TypeSetOCGState = 15,
  Type.e_TypeRendition = 16, Type.e_TypeTrans = 17, Type.e_TypeGoTo3DView = 18
}
 Enumeration for action type.
More...
 

Public Member Functions

 Action (PDFDoc document, PDFDictionary action_dict)
 Constructor, with parameters.
More...
 
 Action (Action action)
 Constructor, with another action object.
More...
 
PDFDictionary GetDict ()
 Get PDF dictionary of current object.
More...
 
PDFDoc GetDocument ()
 Get the PDF document, to which current action belongs.
More...
 
Action GetSubAction (int index)
 Get a sub-action by index.
More...
 
int GetSubActionCount ()
 Get the count of sub-actions.
More...
 
Action.Type GetType ()
 Get action type.
More...
 
void InsertSubAction (int index, Action 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 (int index)
 Remove a sub-action, specified by index.
More...
 
void SetSubAction (int index, Action sub_action)
 Set a sub-action by index.
More...
 

Static Public Member Functions

static Action Create (PDFDoc document, Action.Type 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 Action is the base class for all kinds of PDF actions. For concrete action types, please refer to derived classes. Function Action.Create 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.

Member Enumeration Documentation

◆ NewWindowFlag

Enumeration for new window flag.

Values of this enumeration should be used alone.

Enumerator
e_NewWindowFlagFalse 

"NewWindow" flag is false.

e_NewWindowFlagTrue 

"NewWindow" flag is true.

e_NewWindowFlagNone 

No "NewWindow" flag.

◆ Type

Enumeration for action type.

Values of this enumeration should be used alone.

Enumerator
e_TypeUnknown 

Action type: unknown action.

e_TypeGoto 

Action type: go-to action.

e_TypeGoToR 

Action type: remote go-to action.

e_TypeGoToE 

Action type: embedded go-to action.

e_TypeLaunch 

Action type: launch action.

e_TypeThread 

Action type: thread action.

e_TypeURI 

Action type: uniform resource identifier (URI) action.

e_TypeSound 

Action type: sound action.

e_TypeMovie 

Action type: movie action.

e_TypeHide 

Action type: hide action.

e_TypeNamed 

Action type: named action.

e_TypeSubmitForm 

Action type: submit-form action.

e_TypeResetForm 

Action type: reset-form action.

e_TypeImportData 

Action type: import-data action.

e_TypeJavaScript 

Action type: JavaScript action.

e_TypeSetOCGState 

Action type: set-OCG-state action.

e_TypeRendition 

Action type: rendition action.

e_TypeTrans 

Action type: transition action.

e_TypeGoTo3DView 

Action type: go-to-3D-view action.

Constructor & Destructor Documentation

◆ Action() [1/2]

foxit.pdf.actions.Action.Action ( PDFDoc  document,
PDFDictionary  action_dict 
)
inline

Constructor, with parameters.

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

◆ Action() [2/2]

foxit.pdf.actions.Action.Action ( Action  action)
inline

Constructor, with another action object.

Parameters
[in]actionAnother action object.

Member Function Documentation

◆ Create()

static Action foxit.pdf.actions.Action.Create ( PDFDoc  document,
Action.Type  action_type 
)
inlinestatic

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:
foxit.pdf.actions.Action.Type.e_TypeGoto , foxit.pdf.actions.Action.Type.e_TypeURI , foxit.pdf.actions.Action.Type.e_TypeJavaScript , foxit.pdf.actions.Action.Type.e_TypeNamed , foxit.pdf.actions.Action.Type.e_TypeGoToR , foxit.pdf.actions.Action.Type.e_TypeGoToE , foxit.pdf.actions.Action.Type.e_TypeSubmitForm , foxit.pdf.actions.Action.Type.e_TypeResetForm , foxit.pdf.actions.Action.Type.e_TypeHide , foxit.pdf.actions.Action.Type.e_TypeLaunch , foxit.pdf.actions.Action.Type.e_TypeImportData , foxit.pdf.actions.Action.Type.e_TypeRendition .
Returns
A new action object, with no action data.

◆ GetDict()

PDFDictionary foxit.pdf.actions.Action.GetDict ( )
inline

Get PDF dictionary of current object.

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

◆ GetDocument()

PDFDoc foxit.pdf.actions.Action.GetDocument ( )
inline

Get the PDF document, to which current action belongs.

Returns
A PDF document object.

◆ GetSubAction()

Action foxit.pdf.actions.Action.GetSubAction ( int  index)
inline

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 Action.GetSubActionCount .
Returns
An action object that represents the specified sub-action.

◆ GetSubActionCount()

int foxit.pdf.actions.Action.GetSubActionCount ( )
inline

Get the count of sub-actions.

Returns
Count of sub-actions.

◆ GetType()

Action.Type foxit.pdf.actions.Action.GetType ( )
inline

Get action type.

Returns
Action type. Please refer to values starting from foxit.pdf.actions.Action.Type.e_TypeGoto and this would be one of these values.

◆ InsertSubAction()

void foxit.pdf.actions.Action.InsertSubAction ( int  index,
Action  sub_action 
)
inline

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:
foxit.pdf.actions.Action.Type.e_TypeGoto , foxit.pdf.actions.Action.Type.e_TypeURI , foxit.pdf.actions.Action.Type.e_TypeJavaScript , foxit.pdf.actions.Action.Type.e_TypeNamed , foxit.pdf.actions.Action.Type.e_TypeGoToR , foxit.pdf.actions.Action.Type.e_TypeGoToE , foxit.pdf.actions.Action.Type.e_TypeSubmitForm , foxit.pdf.actions.Action.Type.e_TypeResetForm , foxit.pdf.actions.Action.Type.e_TypeHide , foxit.pdf.actions.Action.Type.e_TypeLaunch , foxit.pdf.actions.Action.Type.e_TypeImportData , foxit.pdf.actions.Action.Type.e_TypeRendition .
Returns
None.

◆ IsEmpty()

bool foxit.pdf.actions.Action.IsEmpty ( )
inline

Check whether current object is empty or not.

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

Returns
true means current object is empty, while false means not.

◆ RemoveAllSubActions()

void foxit.pdf.actions.Action.RemoveAllSubActions ( )
inline

Remove all the sub-actions.

Returns
None.

◆ RemoveSubAction()

void foxit.pdf.actions.Action.RemoveSubAction ( int  index)
inline

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 Action.GetSubActionCount .
Returns
None.

◆ SetSubAction()

void foxit.pdf.actions.Action.SetSubAction ( int  index,
Action  sub_action 
)
inline