public class Action
extends java.lang.Object
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.
Modifier and Type | Field and Description |
---|---|
static int |
e_canonical_format
The Constant e_canonical_format.
|
static int |
e_embed_form
The Constant e_embed_form.
|
static int |
e_excl_F_key
The Constant e_excl_F_key.
|
static int |
e_excl_non_user_annots
The Constant e_excl_non_user_annots.
|
static int |
e_exclude
Flags used by submit form actions.
|
static int |
e_export_format
The Constant e_export_format.
|
static int |
e_get_method
The Constant e_get_method.
|
static int |
e_GoTo
PDF supports the standard action types listed in the following table.
|
static int |
e_GoTo3DView
The Constant e_GoTo3DView.
|
static int |
e_GoToE
The Constant e_GoToE.
|
static int |
e_GoToR
The Constant e_GoToR.
|
static int |
e_Hide
The Constant e_Hide.
|
static int |
e_ImportData
The Constant e_ImportData.
|
static int |
e_include_annotations
The Constant e_include_annotations.
|
static int |
e_include_append_saves
The Constant e_include_append_saves.
|
static int |
e_include_no_value_fields
The Constant e_include_no_value_fields.
|
static int |
e_JavaScript
The Constant e_JavaScript.
|
static int |
e_Launch
The Constant e_Launch.
|
static int |
e_Movie
The Constant e_Movie.
|
static int |
e_Named
The Constant e_Named.
|
static int |
e_Rendition
The Constant e_Rendition.
|
static int |
e_ResetForm
The Constant e_ResetForm.
|
static int |
e_SetOCGState
The Constant e_SetOCGState.
|
static int |
e_Sound
The Constant e_Sound.
|
static int |
e_submit_coordinates
The Constant e_submit_coordinates.
|
static int |
e_submit_pdf
The Constant e_submit_pdf.
|
static int |
e_SubmitForm
The Constant e_SubmitForm.
|
static int |
e_Thread
The Constant e_Thread.
|
static int |
e_Trans
The Constant e_Trans.
|
static int |
e_Unknown
The Constant e_Unknown.
|
static int |
e_URI
The Constant e_URI.
|
static int |
e_xfdf
The Constant e_xfdf.
|
Modifier and Type | Method and Description |
---|---|
static Action |
__Create(long impl,
java.lang.Object ref) |
long |
__GetHandle() |
java.lang.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,
java.lang.String[] field_list)
Creates a new 'Show/Hide Field' action.
|
static Action |
createImportData(PDFDoc doc,
java.lang.String path)
Creates a new 'Import Data' action.
|
static Action |
createJavaScript(PDFDoc doc,
java.lang.String script)
Creates a new 'JavaScript' action.
|
static Action |
createLaunch(PDFDoc doc,
java.lang.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,
java.lang.String uri)
Create a new URI action.
|
boolean |
equals(java.lang.Object in_action)
Compares two Action objects for equality.
|
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.
|
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
|
int |
getFormActionFlag(int flag)
Get the form action flag.
|
Obj |
GetNext()
Get the next action dictionary or dictionaries in an array.
|
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.
|
public static final int e_GoTo
public static final int e_GoToR
public static final int e_GoToE
public static final int e_Launch
public static final int e_Thread
public static final int e_URI
public static final int e_Sound
public static final int e_Movie
public static final int e_Hide
public static final int e_Named
public static final int e_SubmitForm
public static final int e_ResetForm
public static final int e_ImportData
public static final int e_JavaScript
public static final int e_SetOCGState
public static final int e_Rendition
public static final int e_Trans
public static final int e_GoTo3DView
public static final int e_Unknown
public static final int e_exclude
public static final int e_include_no_value_fields
public static final int e_export_format
public static final int e_get_method
public static final int e_submit_coordinates
public static final int e_xfdf
public static final int e_include_append_saves
public static final int e_include_annotations
public static final int e_submit_pdf
public static final int e_canonical_format
public static final int e_excl_non_user_annots
public static final int e_excl_F_key
public static final int e_embed_form
public Action(Obj in_obj) throws PDFNetException
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
public static Action createGoto(Destination dest) throws PDFNetException
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
public static Action createGoto(byte[] key, Destination dest) throws PDFNetException
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
public static Action createGotoRemote(FileSpec file, int page_num) throws PDFNetException
file
- The file referred to by the action.page_num
- A page number within the remote document. The first page is
numbered 0.PDFNetException
public static Action createGotoRemote(FileSpec file, int page_num, boolean new_window) throws PDFNetException
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
public static Action createURI(PDFDoc doc, java.lang.String uri) throws PDFNetException
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
public static Action createSubmitForm(FileSpec url) throws PDFNetException
url
- A URL file specification giving the uniform resource locator (URL)
of the script at the Web server that will process the submission.PDFNetException
public static Action createLaunch(PDFDoc doc, java.lang.String path)
doc
- the document in which to create the actionpath
- the full path of the file to be openedpublic static Action createHideField(PDFDoc doc, java.lang.String[] field_list)
doc
- the document in which to create the actionfield_list
- field the list of fields to hidepublic static Action createImportData(PDFDoc doc, java.lang.String path)
doc
- the document in which to create the actionpath
- the full path of the FDF filepublic static Action createResetForm(PDFDoc doc)
doc
- the document in which to create the actionpublic static Action createJavaScript(PDFDoc doc, java.lang.String script)
doc
- the document in which to create the actionscript
- the JavaScript script to be executedpublic boolean needsWriteLock() throws PDFNetException
PDFNetException
public KeyStrokeActionResult executeKeyStrokeAction(KeyStrokeEventData data) throws PDFNetException
data
- Data that contains previous text, added text,and added position information.PDFNetException
public void Execute() throws PDFNetException
PDFNetException
public Obj GetNext() throws PDFNetException
PDFNetException
public boolean equals(java.lang.Object in_action)
equals
in class java.lang.Object
in_action
- A reference to an existing Action object.public int hashCode()
hashCode
in class java.lang.Object
public boolean isValid() throws PDFNetException
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
public int getType() throws PDFNetException
PDFNetException
public Destination getDest() throws PDFNetException
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
public int getFormActionFlag(int flag) throws PDFNetException
Note: Action flags are currently only used by submit and reset form actions.
flag
- the flagPDFNetException
public void setFormActionFlag(int flag, boolean value) throws PDFNetException
flag
- given field flagvalue
- value of the flagPDFNetException
public Obj getSDFObj()
public static Action __Create(long impl, java.lang.Object ref)
public long __GetHandle()
public java.lang.Object __GetRefHandle()