public class GotoPageAction extends Action
Modifier and Type | Field and Description |
---|---|
static String |
ACTION_TYPE_DESCRIPTION |
static int |
ZOOM_EXPLICIT
Set the zoom scale explicitly.
|
static int |
ZOOM_FIT
Zoom the view to fit the target page both horizontally and vertically.
|
static int |
ZOOM_FIT_HORIZONTAL
Zoom the target page so that it will fit horizontally.
|
static int |
ZOOM_FIT_VERTICAL
Zoom the target page so that it will fit vertically.
|
static int |
ZOOM_RETAIN
Do not adjust the zoom scale, retain the current value.
|
OPEN_EXISTING_WINDOW, OPEN_NEW_WINDOW, OPEN_USER_PREFERENCE
Constructor and Description |
---|
GotoPageAction(IPDFPage pdfPage)
Constructs a GotoPageAction with an
IPDFPage . |
GotoPageAction(IPDFPage pdfPage,
int zoomMode)
Constructs a GotoPageAction with an
IPDFPage and a zoom
mode. |
GotoPageAction(IPDFPage pdfPage,
int x,
int y,
double scale)
Constructs a GotoPageAction with an
IPDFPage and with values
to set the x and y coordinates as well as the zoom scale. |
GotoPageAction(String destinationName)
Constructs a GotoPageAction with a named destination.
|
Modifier and Type | Method and Description |
---|---|
String |
getActionType()
Returns the action type.
|
String |
getActionTypeDesc()
Returns the action type description
|
String |
getDestinationName()
Returns the destination name associated with this action, or null if there isn't one.
|
IPDFPage |
getPage()
Returns the page for this GotoPageAction.
|
double |
getScale()
Returns the scale, the value of the scale that the viewer will use after
setting the page.
|
int |
getX()
Returns the x coordinate of the GotoPageAction.
|
int |
getY()
Returns the y coordinate of the GotoPageAction.
|
int |
getZoomMode()
Returns the zoom mode.
|
void |
setDestinationName(String destinationName)
Set the destination name this action should go to
|
void |
setScale(double scale)
Sets the scale, 0..1.
|
void |
setX(int x)
Sets the x coordinate of the GotoPageAction.
|
void |
setY(int y)
Sets the y coordinate of the GotoPageAction.
|
void |
setZoomMode(int zoomMode)
Sets the zoom mode.
|
String |
toString()
Returns the description of the action.
|
getNextAction, setNextAction
public static String ACTION_TYPE_DESCRIPTION
public static final int ZOOM_RETAIN
public static final int ZOOM_FIT
public static final int ZOOM_FIT_HORIZONTAL
public static final int ZOOM_FIT_VERTICAL
public static final int ZOOM_EXPLICIT
public GotoPageAction(IPDFPage pdfPage)
IPDFPage
. This
constructor will create an action that will retain the current zoom
level.pdfPage
- The IPDFPage
to displaypublic GotoPageAction(IPDFPage pdfPage, int x, int y, double scale)
IPDFPage
and with values
to set the x and y coordinates as well as the zoom scale.pdfPage
- The IPDFPage
to displayx
- The x coordinatey
- The y coordinatescale
- The zoom scale as a decimal. .5 will be 50% zoom, 5 will be
500%. If set to -1 or 0 to retain the current valuepublic GotoPageAction(IPDFPage pdfPage, int zoomMode)
IPDFPage
and a zoom
mode. The zoom mode can be any of the predefined constants in this class
that start with ZOOM_.pdfPage
- The IPDFPage
to displayzoomMode
- The new mode. If the mode is fit horizontal, or fit vertical,
the viewer will also look at the TagetTop and TargetLeft
values respectively.public GotoPageAction(String destinationName)
destinationName
- String representing the named destination from the document this action should usepublic IPDFPage getPage()
public String getActionType()
getActionType
in class Action
public String getActionTypeDesc()
getActionTypeDesc
in class Action
public String toString()
public int getX()
public void setX(int x)
x
- coordinate of the GotoPageActionpublic int getY()
public void setY(int y)
y
- coordinate of the GotoPageActionpublic double getScale()
public void setScale(double scale)
scale
- public int getZoomMode()
public void setZoomMode(int zoomMode)
zoomMode
- The new value of the zoom mode.public void setDestinationName(String destinationName)
destinationName
- name of the destination for this goto actionpublic String getDestinationName()