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

Public Member Functions

 Action (PDFDoc document, PDFDictionary action_dict)
 Constructor, with parameters. More...
 
 Action (Action action)
 Constructor, with another action object. More...
 
synchronized void delete ()
 Clean up related resources immediately. More...
 
PDFDictionary getDict () throws com.foxit.sdk.PDFException
 Get PDF dictionary of current object. More...
 
PDFDoc getDocument () throws com.foxit.sdk.PDFException
 Get the PDF document, to which current action belongs. More...
 
Action getSubAction (int index) throws com.foxit.sdk.PDFException
 Get a sub-action by index. More...
 
int getSubActionCount () throws com.foxit.sdk.PDFException
 Get the count of sub-actions. More...
 
int getType () throws com.foxit.sdk.PDFException
 Get action type. More...
 
void insertSubAction (int index, Action sub_action) throws com.foxit.sdk.PDFException
 Insert a new sub-action to the location specified by index. More...
 
boolean isEmpty ()
 Check whether current object is empty or not. More...
 
void removeAllSubActions () throws com.foxit.sdk.PDFException
 Remove all the sub-actions. More...
 
void removeSubAction (int index) throws com.foxit.sdk.PDFException
 Remove a sub-action, specified by index. More...
 
void setSubAction (int index, Action sub_action) throws com.foxit.sdk.PDFException
 Set a sub-action by index. More...
 
- Public Member Functions inherited from com.foxit.sdk.common.Base
synchronized void delete ()
 Clean up related resources immediately. More...
 

Static Public Member Functions

static Action create (PDFDoc document, int action_type) throws com.foxit.sdk.PDFException
 Create a new action, for specified action type. More...
 

Static Public Attributes

static final int e_NewWindowFlagFalse = 0
 "NewWindow" flag is false.
 
static final int e_NewWindowFlagNone = 2
 No "NewWindow" flag.
 
static final int e_NewWindowFlagTrue = 1
 "NewWindow" flag is true.
 
static final int e_TypeGoto = 1
 Action type: go-to action.
 
static final int e_TypeGoTo3DView = 18
 Action type: go-to-3D-view action.
 
static final int e_TypeGoToE = 3
 Action type: embedded go-to action.
 
static final int e_TypeGoToR = 2
 Action type: remote go-to action.
 
static final int e_TypeHide = 9
 Action type: hide action.
 
static final int e_TypeImportData = 13
 Action type: import-data action.
 
static final int e_TypeJavaScript = 14
 Action type: JavaScript action.
 
static final int e_TypeLaunch = 4
 Action type: launch action.
 
static final int e_TypeMovie = 8
 Action type: movie action.
 
static final int e_TypeNamed = 10
 Action type: named action.
 
static final int e_TypeRendition = 16
 Action type: rendition action.
 
static final int e_TypeResetForm = 12
 Action type: reset-form action.
 
static final int e_TypeSetOCGState = 15
 Action type: set-OCG-state action.
 
static final int e_TypeSound = 7
 Action type: sound action.
 
static final int e_TypeSubmitForm = 11
 Action type: submit-form action.
 
static final int e_TypeThread = 5
 Action type: thread action.
 
static final int e_TypeTrans = 17
 Action type: transition action.
 
static final int e_TypeUnknown = 0
 Action type: unknown action.
 
static final int e_TypeURI = 6
 Action type: uniform resource identifier (URI) action.
 

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.

Constructor & Destructor Documentation

◆ Action() [1/2]

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

Constructor, with parameters.

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

◆ Action() [2/2]

com.foxit.sdk.pdf.actions.Action.Action ( Action  action)

Constructor, with another action object.

Parameters
[in]actionAnother action object.

Member Function Documentation

◆ create()

static Action com.foxit.sdk.pdf.actions.Action.create ( PDFDoc  document,
int  action_type 
) throws com.foxit.sdk.PDFException
static

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

◆ delete()

synchronized void com.foxit.sdk.pdf.actions.Action.delete ( )

Clean up related resources immediately.

Returns
None.
Note
Once this function is called, current object cannot be used anymore.

◆ getDict()

PDFDictionary com.foxit.sdk.pdf.actions.Action.getDict ( ) throws com.foxit.sdk.PDFException

Get PDF dictionary of current object.

Returns
The PDF dictionary.

◆ getDocument()

PDFDoc com.foxit.sdk.pdf.actions.Action.getDocument ( ) throws com.foxit.sdk.PDFException

Get the PDF document, to which current action belongs.

Returns
A PDF document object.

◆ getSubAction()

Action com.foxit.sdk.pdf.actions.Action.getSubAction ( int  index) throws com.foxit.sdk.PDFException

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 com.foxit.sdk.pdf.actions.Action.getSubActionCount ( ) throws com.foxit.sdk.PDFException

Get the count of sub-actions.

Returns
Count of sub-actions.

◆ getType()

int com.foxit.sdk.pdf.actions.Action.getType ( ) throws com.foxit.sdk.PDFException

Get action type.

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

◆ insertSubAction()

void com.foxit.sdk.pdf.actions.Action.insertSubAction ( int  index,
Action  sub_action 
) throws com.foxit.sdk.PDFException

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

◆ isEmpty()

boolean com.foxit.sdk.pdf.actions.Action.isEmpty ( )

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 com.foxit.sdk.pdf.actions.Action.removeAllSubActions ( ) throws com.foxit.sdk.PDFException

Remove all the sub-actions.

Returns
None.

◆ removeSubAction()

void com.foxit.sdk.pdf.actions.Action.removeSubAction ( int  index) throws com.foxit.sdk.PDFException

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()