public class PDFAction
extends java.lang.Object
PDFAction
represents as the base PDF action class.
It can be constructed by the following ways.
Example:
PDFAction action = PDFBookmarkIterator.getAction(int); PDFAction action = PDFDocument.getAction(int, int); PDFAction action = PDFPage.getAction(int, int); PDFAction action = Link.getAction(int, int); PDFAction action = PDFFormField.getAction(int, int);
PDFBookmarkIterator
,
PDFDocument
,
PDFPage
,
Link
,
PDFFormField
Modifier and Type | Field and Description |
---|---|
static int |
TYPE_EMBEDDEDGOTO
Go to a destination within embedded another document.
|
static int |
TYPE_GOTO
Go to a destination within current document.
|
static int |
TYPE_HIDE
Hide or show one or more annotations.
|
static int |
TYPE_IMPORTDATA
Import Forms Data Format (FDF) data into the document's interactive form.
|
static int |
TYPE_JAVASCRIPT
Run a javascript.
|
static int |
TYPE_LAUNCH
Launch an application or open a file.
|
static int |
TYPE_NAMED
Run a named action.
|
static int |
TYPE_REMOTEGOTO
Go to a destination within another document.
|
static int |
TYPE_RENDITION
Play a multimedia.
|
static int |
TYPE_RESETFORM
Reset selected interactive form fields to their default values.
|
static int |
TYPE_SUBMITFORM
Transmit the names and values of selected interactive form fields.
|
static int |
TYPE_UNSUPPORTED
Unsupported action type.
|
static int |
TYPE_URI
Universal Resource Identifier, including web pages and other Internet
based resources.
|
Modifier and Type | Method and Description |
---|---|
static PDFAction |
createEmbeddedGotoAction(PDFEmbeddedGotoActionTarget target,
PDFAttachment attachment,
PDFDestination dest,
boolean isNewWindow)
Create a new embedded go-to action.
|
static PDFAction |
createEmbeddedGotoAction(PDFEmbeddedGotoActionTarget target,
PDFAttachment attachment,
java.lang.String destName,
boolean isNewWindow)
Create a new embedded go-to action.
|
static PDFAction |
createGotoAction(PDFDestination destination)
Create a new go-to action.
|
static PDFAction |
createHideAction(java.lang.String[] fieldsList,
boolean isHide)
Create a new hide action.
|
static PDFAction |
createImportDataAction(PDFAttachment attachment)
Create a new import-data action.
|
static PDFAction |
createJavascriptAction(java.lang.String script)
Create a new JavaScript action.
|
static PDFAction |
createLaunchAction(java.lang.String fileName,
java.lang.String defaultPath,
java.lang.String operations,
java.lang.String parameters,
boolean isNewWindow)
Create a new launch action.
|
static PDFAction |
createNamedAction(java.lang.String name)
Create a new named action.
|
static PDFAction |
createRemoteGotoAction(java.lang.String fileName,
PDFDestination destination)
Create a new remote go-to action.
|
static PDFAction |
createRemoteGotoAction(java.lang.String fileName,
java.lang.String destName)
Create a new embedded go-to action.
|
static PDFAction |
createResetFormAction(int flags,
java.lang.String[] fields)
Create a new reset-form action.
|
static PDFAction |
createSubmitFormAction(int flags,
java.lang.String[] fields,
PDFAttachment attachment)
Create a new submit-form action.
|
static PDFAction |
createURIAction(java.lang.String url,
boolean isMapMousePos)
Create a new URI action.
|
long |
getHandle()
Get the action handle.
|
int |
getType()
Get action type.
|
void |
release()
Release all resources of the action.
|
public static final int TYPE_UNSUPPORTED
public static final int TYPE_GOTO
public static final int TYPE_REMOTEGOTO
public static final int TYPE_EMBEDDEDGOTO
public static final int TYPE_URI
public static final int TYPE_LAUNCH
public static final int TYPE_JAVASCRIPT
public static final int TYPE_HIDE
public static final int TYPE_NAMED
public static final int TYPE_SUBMITFORM
public static final int TYPE_RESETFORM
public static final int TYPE_IMPORTDATA
public static final int TYPE_RENDITION
public long getHandle()
public static PDFAction createGotoAction(PDFDestination destination) throws PDFException
destination
- A PDFDestination
object.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
PDFDestination
public static PDFAction createHideAction(java.lang.String[] fieldsList, boolean isHide) throws PDFException
fieldsList
- A String
objects array which are names of fields to be
included or excluded.isHide
- A flag indicating whether to hide the annotations (true) or
show it (false). Default value: true.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public static PDFAction createJavascriptAction(java.lang.String script) throws PDFException
script
- The JavaScript script to be executed.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public static PDFAction createURIAction(java.lang.String url, boolean isMapMousePos) throws PDFException
url
- The URL address.isMapMousePos
- Whether to track the mouse position when the URI is resolved.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public static PDFAction createLaunchAction(java.lang.String fileName, java.lang.String defaultPath, java.lang.String operations, java.lang.String parameters, boolean isNewWindow) throws PDFException
fileName
- The application name to be launched or the document to be
opened or printeddefaultPath
- A String
object specifying the default directory in
standard DOS syntax.operations
- A String
object specifying the
operation to perform: open: Open a document. print: Print a
document.parameters
- A String
object to be passed to the
application.isNewWindow
- A flag specifying whether to open the destination document in
a new window. This parameter is ignored if the file designated
by the fileName is not a PDF document.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public static PDFAction createNamedAction(java.lang.String name) throws PDFException
name
- A String
object which is an action name.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public static PDFAction createResetFormAction(int flags, java.lang.String[] fields) throws PDFException
flags
- Flags specify including or excluding fields. It should be one
of the following values at present: fields
- A String
objects array which are names of fields to be
included or excluded.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public static PDFAction createSubmitFormAction(int flags, java.lang.String[] fields, PDFAttachment attachment) throws PDFException
flags
- A set of flags specifying various characteristics of the
action.fields
- A String
objects array which are names of fields.attachment
- The attachment which the form data is submitted.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
PDFAttachment
public static PDFAction createImportDataAction(PDFAttachment attachment) throws PDFException
attachment
- The attachment from which form data is imported.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
PDFAttachment
public static PDFAction createRemoteGotoAction(java.lang.String fileName, PDFDestination destination) throws PDFException
fileName
- File name that remote to.destination
- A PDFDestination
object.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
PDFDestination
public static PDFAction createRemoteGotoAction(java.lang.String fileName, java.lang.String destName) throws PDFException
fileName
- File name that remote to.destName
- Destination name.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public static PDFAction createEmbeddedGotoAction(PDFEmbeddedGotoActionTarget target, PDFAttachment attachment, java.lang.String destName, boolean isNewWindow) throws PDFException
target
- A PDFEmbeddedGotoActionTarget
object which
specifies path information to the target document.attachment
- A PDFAttachment
object which is the root
document of the target.destName
- Destination name.isNewWindow
- Whether a new window should be opened or not.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
PDFAttachment
,
PDFEmbeddedGotoActionTarget
public static PDFAction createEmbeddedGotoAction(PDFEmbeddedGotoActionTarget target, PDFAttachment attachment, PDFDestination dest, boolean isNewWindow) throws PDFException
target
- A PDFEmbeddedGotoActionTarget
object which
specifies path information to the target document.attachment
- A PDFAttachment
object which is the root
document of the target.dest
- Destination data.isNewWindow
- Whether a new window should be opened or not.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
PDFAttachment
,
PDFEmbeddedGotoActionTarget
public int getType()
public void release() throws PDFException
PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException