java.lang.Object | |
↳ | com.pdftron.pdf.Action |
Actions are typically what happens when a user clicks on a link or bookmark. Instead of simply jumping to a destination in the document, an annotation or outline item can specify an action for the viewer application to perform, such as launching an application, playing a sound, or changing an annotation's appearance state.
Note: Although the Action class provides utility functions for most commonly used action types, it is possible to read, write, and edit any action type using SDF API and dictionary entries described in Section 8.5 in the PDF Reference Manual.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | e_GoTo | PDF supports the standard action types listed in the following table. | |||||||||
int | e_GoTo3DView | The Constant e_GoTo3DView. | |||||||||
int | e_GoToE | The Constant e_GoToE. | |||||||||
int | e_GoToR | The Constant e_GoToR. | |||||||||
int | e_Hide | The Constant e_Hide. | |||||||||
int | e_ImportData | The Constant e_ImportData. | |||||||||
int | e_JavaScript | The Constant e_JavaScript. | |||||||||
int | e_Launch | The Constant e_Launch. | |||||||||
int | e_Movie | The Constant e_Movie. | |||||||||
int | e_Named | The Constant e_Named. | |||||||||
int | e_Rendition | The Constant e_Rendition. | |||||||||
int | e_ResetForm | The Constant e_ResetForm. | |||||||||
int | e_SetOCGState | The Constant e_SetOCGState. | |||||||||
int | e_Sound | The Constant e_Sound. | |||||||||
int | e_SubmitForm | The Constant e_SubmitForm. | |||||||||
int | e_Thread | The Constant e_Thread. | |||||||||
int | e_Trans | The Constant e_Trans. | |||||||||
int | e_URI | The Constant e_URI. | |||||||||
int | e_Unknown | The Constant e_Unknown. | |||||||||
int | e_canonical_format | The Constant e_canonical_format. | |||||||||
int | e_embed_form | The Constant e_embed_form. | |||||||||
int | e_excl_F_key | The Constant e_excl_F_key. | |||||||||
int | e_excl_non_user_annots | The Constant e_excl_non_user_annots. | |||||||||
int | e_exclude | Flags used by submit form actions. | |||||||||
int | e_export_format | The Constant e_export_format. | |||||||||
int | e_get_method | The Constant e_get_method. | |||||||||
int | e_include_annotations | The Constant e_include_annotations. | |||||||||
int | e_include_append_saves | The Constant e_include_append_saves. | |||||||||
int | e_include_no_value_fields | The Constant e_include_no_value_fields. | |||||||||
int | e_submit_coordinates | The Constant e_submit_coordinates. | |||||||||
int | e_submit_pdf | The Constant e_submit_pdf. | |||||||||
int | e_xfdf | The Constant e_xfdf. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Action(Obj in_obj)
A constructor.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
Execute()
Executes current action; this will only work for some action types that can be executed
only using the information contained in the action object or the associated PDF doc.
| ||||||||||
Obj |
GetNext()
Get the next action dictionary or dictionaries in an array.
| ||||||||||
static Action | __Create(long impl, Object ref) | ||||||||||
long | __GetHandle() | ||||||||||
Object | __GetRefHandle() | ||||||||||
static Action |
createGoto(byte[] key, Destination dest)
Creates a new 'GoTo' action using a 'Named Destination'.
| ||||||||||
static Action |
createGoto(Destination dest)
Creates a new 'GoTo'action.
| ||||||||||
static Action |
createGotoRemote(FileSpec file, int page_num)
Creates a new 'GoToR' action.
| ||||||||||
static Action |
createGotoRemote(FileSpec file, int page_num, boolean new_window)
Creates a new 'GoToR' action.
| ||||||||||
static Action |
createHideField(PDFDoc doc, String[] field_list)
Creates a new 'Show/Hide Field' action.
| ||||||||||
static Action |
createImportData(PDFDoc doc, String path)
Creates a new 'Import Data' action.
| ||||||||||
static Action |
createJavaScript(PDFDoc doc, String script)
Creates a new 'JavaScript' action.
| ||||||||||
static Action |
createLaunch(PDFDoc doc, String path)
Creates a new 'Launch' action.
| ||||||||||
static Action |
createResetForm(PDFDoc doc)
Creates a new 'Reset Form' action.
| ||||||||||
static Action |
createSubmitForm(FileSpec url)
Creates a new 'SubmitForm' action.
| ||||||||||
static Action |
createURI(PDFDoc doc, String uri)
Create a new URI action.
| ||||||||||
boolean |
equals(Object in_action)
Compares two Action objects for equality.
| ||||||||||
KeyStrokeActionResult |
executeKeyStrokeAction(KeyStrokeEventData data)
Executes KeyStrokeAction, this shall be performed when the user modifies a character in a text field
or combo box or modifies the selecton in a scrollable list box.
| ||||||||||
Destination |
getDest()
Get the destination view of the Action
Note: This only applies for Actions whose subtype is "GoTo". | ||||||||||
int |
getFormActionFlag(int flag)
Get the form action flag.
| ||||||||||
Obj |
getSDFObj()
Get the SDFObj.
| ||||||||||
int |
getType()
Get the action type.
| ||||||||||
int | hashCode() | ||||||||||
boolean |
isValid()
Indicates whether the Action is valid (non-null).
| ||||||||||
boolean |
needsWriteLock()
Test whether this action needs WriteLock
| ||||||||||
void |
setFormActionFlag(int flag, boolean value)
Set the value of a given field flag.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
PDF supports the standard action types listed in the following table. Plug-in extensions may add new action types.
The Constant e_GoTo3DView.
The Constant e_GoToE.
The Constant e_GoToR.
The Constant e_Hide.
The Constant e_ImportData.
The Constant e_JavaScript.
The Constant e_Launch.
The Constant e_Movie.
The Constant e_Named.
The Constant e_Rendition.
The Constant e_ResetForm.
The Constant e_SetOCGState.
The Constant e_Sound.
The Constant e_SubmitForm.
The Constant e_Thread.
The Constant e_Trans.
The Constant e_URI.
The Constant e_Unknown.
The Constant e_canonical_format.
The Constant e_embed_form.
The Constant e_excl_F_key.
The Constant e_excl_non_user_annots.
Flags used by submit form actions. Exclude flag is also used by reset form action. No other action types use flags in the current version of PDF standard (ISO 2300).
The Constant e_export_format.
The Constant e_get_method.
The Constant e_include_annotations.
The Constant e_include_append_saves.
The Constant e_include_no_value_fields.
The Constant e_submit_coordinates.
The Constant e_submit_pdf.
The Constant e_xfdf.
A constructor. Creates an Action and initializes it using given Cos/SDF object.
Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.
in_obj | Pointer to the Cos/SDF object. |
---|
PDFNetException |
---|
Executes current action; this will only work for some action types that can be executed only using the information contained in the action object or the associated PDF doc. See also PDFViewCtrl::ExecuteAction()
PDFNetException |
---|
Get the next action dictionary or dictionaries in an array.
PDFNetException |
---|
Creates a new 'GoTo' action using a 'Named Destination'. GoTo action takes the user to the specified 'Named Destination' view located in the same document.
key | - a string buffer representing the destination name. The named destination will be stored in document's '/Dest' SDF::NameTree. |
---|---|
dest | The explicit destination used to create the named destination. |
PDFNetException |
---|
Creates a new 'GoTo'action. GoTo action takes the user to the specified Destination view located in the same document.
Note: This method can only be used for destinations in the same document as the source document. For cross-document links use Action::CreateGotoRemote().
dest | A Destination for the new Action. |
---|
PDFNetException |
---|
Creates a new 'GoToR' action. A remote go-to action is similar to an ordinary go-to action but jumps to a destination in another PDF file instead of the current file.
file | The file referred to by the action. |
---|---|
page_num | A page number within the remote document. The first page is numbered 0. |
PDFNetException |
---|
Creates a new 'GoToR' action. See the above method for details.
file | The file referred to by the action. |
---|---|
page_num | A page number within the remote document. The first page is numbered 0. |
new_window | A flag specifying whether to open the destination document in a new window. If new_window is false, the destination document replaces the current document in the same window, otherwise the viewer application should behave in accordance with the current user preference. |
PDFNetException |
---|
Creates a new 'Show/Hide Field' action. A show/hide field action shows or hide certain fields when it's invoked.
doc | the document in which to create the action |
---|---|
field_list | field the list of fields to hide |
Creates a new 'Import Data' action. An import data action imports form data from a FDF file into a PDF document.
doc | the document in which to create the action |
---|---|
path | the full path of the FDF file |
Creates a new 'JavaScript' action. A javascript action executes a JavaScript script when it's invoked.
doc | the document in which to create the action |
---|---|
script | the JavaScript script to be executed |
Creates a new 'Launch' action. A launch action opens up a file using the most appropriate program.
doc | the document in which to create the action |
---|---|
path | the full path of the file to be opened |
Creates a new 'Reset Form' action. A reset form action reset choosen form fields to their default value.
doc | the document in which to create the action |
---|
Creates a new 'SubmitForm' action. A submit-form action transmits the names and values of selected interactive form fields to a specified uniform resource locator (URL), presumably the address of a Web server that will process them and send back a response.
url | A URL file specification giving the uniform resource locator (URL) of the script at the Web server that will process the submission. |
---|
PDFNetException |
---|
Create a new URI action. The URL action is typically resolved by opening a URL in the default web browser.
doc | The document in which to create the action. |
---|---|
uri | The uniform resource identifier to resolve, encoded in 7-bit ASCII. A uniform resource identifier (URI) is a string that identifies (resolves to) a resource on the Internet typically a file that is the destination of a hypertext link, although it can also resolve to a query or other entity. (URIs are described in Internet RFC 2396, Uniform Resource Identifiers (URI). |
PDFNetException |
---|
Compares two Action objects for equality.
in_action | A reference to an existing Action object. |
---|
Executes KeyStrokeAction, this shall be performed when the user modifies a character in a text field or combo box or modifies the selecton in a scrollable list box. This action checks the added text for validity and reject or modify it.
data | Data that contains previous text, added text,and added position information. |
---|
PDFNetException |
---|
Get the destination view of the Action
Note: This only applies for Actions whose subtype is "GoTo".
Note: All named destinations are automatically resolved to the explicit destination so you can access destination members directly.
PDFNetException |
---|
Get the form action flag.
Note: Action flags are currently only used by submit and reset form actions.
flag | the flag |
---|
PDFNetException |
---|
Indicates whether the Action is valid (non-null).
Note: If this method returns false the underlying SDF/Cos object is null and the Action object should be treated as null as well.
PDFNetException |
---|
Test whether this action needs WriteLock
PDFNetException |
---|
Set the value of a given field flag. Action flags are currently only used by submit and reset form actions.
flag | given field flag |
---|---|
value | value of the flag |
PDFNetException |
---|