Package com.sun.pdfview
Class PDFDestination
java.lang.Object
com.sun.pdfview.PDFDestination
Represents a destination in a PDF file. Destinations take 3 forms:
- An explicit destination, which contains a reference to a page as well as some stuff about how to fit it into the window.
- A named destination, which uses the PDF file's Dests entry in the document catalog to map a name to an explicit destination
- A string destintation, which uses the PDF file's Dests entry. in the name directory to map a string to an explicit destination.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate float
the bottom coordinate of the fit area, if applicablestatic final int
static final int
static final int
static final int
static final int
static final int
static final int
private float
the left coordinate of the fit area, if applicableprivate PDFObject
the page we refer toprivate float
the right coordinate of the fit area, if applicableprivate float
the top coordinate of the fit area, if applicableprivate int
the type of this destination (from the list above)static final int
The known types of destinationprivate float
the zoom, if applicable -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
PDFDestination
(PDFObject pageObj, int type) Creates a new instance of PDFDestination -
Method Summary
Modifier and TypeMethodDescriptionfloat
Get the bottom coordinate valueprivate static PDFObject
getDestFromName
(PDFObject name, PDFObject root) Get a destination, given a name.private static PDFObject
getDestFromString
(PDFObject str, PDFObject root) Get a destination, given a string.static PDFDestination
getDestination
(PDFObject obj, PDFObject root) Get a destination from either an array (explicit destination), a name (named destination) or a string (name tree destination).float
getLeft()
Get the left coordinate valuegetPage()
Get the PDF Page object associated with this destinationfloat
getRight()
Get the right coordinate valuefloat
getTop()
Get the top coordinate valueint
getType()
Get the type of this destinationfloat
getZoom()
Get the zoom valuevoid
setBottom
(float bottom) Set the bottom coordinate valuevoid
setLeft
(float left) Set the left coordinate valuevoid
setRight
(float right) Set the right coordinate valuevoid
setTop
(float top) Set the top coordinate valuevoid
setZoom
(float zoom) Set the zoom value
-
Field Details
-
XYZ
public static final int XYZThe known types of destination- See Also:
-
FIT
public static final int FIT- See Also:
-
FITH
public static final int FITH- See Also:
-
FITV
public static final int FITV- See Also:
-
FITR
public static final int FITR- See Also:
-
FITB
public static final int FITB- See Also:
-
FITBH
public static final int FITBH- See Also:
-
FITBV
public static final int FITBV- See Also:
-
type
private int typethe type of this destination (from the list above) -
pageObj
the page we refer to -
left
private float leftthe left coordinate of the fit area, if applicable -
right
private float rightthe right coordinate of the fit area, if applicable -
top
private float topthe top coordinate of the fit area, if applicable -
bottom
private float bottomthe bottom coordinate of the fit area, if applicable -
zoom
private float zoomthe zoom, if applicable
-
-
Constructor Details
-
PDFDestination
Creates a new instance of PDFDestination- Parameters:
pageObj
- the page object this destination refers totype
- the type of page this object refers to
-
-
Method Details
-
getDestination
Get a destination from either an array (explicit destination), a name (named destination) or a string (name tree destination).- Parameters:
obj
- the PDFObject representing this destinationroot
- the root of the PDF object tree- Throws:
IOException
-
getType
public int getType()Get the type of this destination -
getPage
Get the PDF Page object associated with this destination -
getLeft
public float getLeft()Get the left coordinate value -
setLeft
public void setLeft(float left) Set the left coordinate value -
getRight
public float getRight()Get the right coordinate value -
setRight
public void setRight(float right) Set the right coordinate value -
getTop
public float getTop()Get the top coordinate value -
setTop
public void setTop(float top) Set the top coordinate value -
getBottom
public float getBottom()Get the bottom coordinate value -
setBottom
public void setBottom(float bottom) Set the bottom coordinate value -
getZoom
public float getZoom()Get the zoom value -
setZoom
public void setZoom(float zoom) Set the zoom value -
getDestFromName
Get a destination, given a name. This means the destination is in the root node's dests dictionary.- Throws:
IOException
-
getDestFromString
Get a destination, given a string. This means the destination is in the root node's names dictionary.- Throws:
IOException
-