Package com.sun.pdfview
Class PDFDestination
- java.lang.Object
-
- com.sun.pdfview.PDFDestination
-
public class PDFDestination extends java.lang.ObjectRepresents 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
Fields Modifier and Type Field Description private floatbottomthe bottom coordinate of the fit area, if applicablestatic intFITstatic intFITBstatic intFITBHstatic intFITBVstatic intFITHstatic intFITRstatic intFITVprivate floatleftthe left coordinate of the fit area, if applicableprivate PDFObjectpageObjthe page we refer toprivate floatrightthe right coordinate of the fit area, if applicableprivate floattopthe top coordinate of the fit area, if applicableprivate inttypethe type of this destination (from the list above)static intXYZThe known types of destinationprivate floatzoomthe zoom, if applicable
-
Constructor Summary
Constructors Modifier Constructor Description protectedPDFDestination(PDFObject pageObj, int type)Creates a new instance of PDFDestination
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description floatgetBottom()Get the bottom coordinate valueprivate static PDFObjectgetDestFromName(PDFObject name, PDFObject root)Get a destination, given a name.private static PDFObjectgetDestFromString(PDFObject str, PDFObject root)Get a destination, given a string.static PDFDestinationgetDestination(PDFObject obj, PDFObject root)Get a destination from either an array (explicit destination), a name (named destination) or a string (name tree destination).floatgetLeft()Get the left coordinate valuePDFObjectgetPage()Get the PDF Page object associated with this destinationfloatgetRight()Get the right coordinate valuefloatgetTop()Get the top coordinate valueintgetType()Get the type of this destinationfloatgetZoom()Get the zoom valuevoidsetBottom(float bottom)Set the bottom coordinate valuevoidsetLeft(float left)Set the left coordinate valuevoidsetRight(float right)Set the right coordinate valuevoidsetTop(float top)Set the top coordinate valuevoidsetZoom(float zoom)Set the zoom value
-
-
-
Field Detail
-
XYZ
public static final int XYZ
The known types of destination- See Also:
- Constant Field Values
-
FIT
public static final int FIT
- See Also:
- Constant Field Values
-
FITH
public static final int FITH
- See Also:
- Constant Field Values
-
FITV
public static final int FITV
- See Also:
- Constant Field Values
-
FITR
public static final int FITR
- See Also:
- Constant Field Values
-
FITB
public static final int FITB
- See Also:
- Constant Field Values
-
FITBH
public static final int FITBH
- See Also:
- Constant Field Values
-
FITBV
public static final int FITBV
- See Also:
- Constant Field Values
-
type
private int type
the type of this destination (from the list above)
-
pageObj
private PDFObject pageObj
the page we refer to
-
left
private float left
the left coordinate of the fit area, if applicable
-
right
private float right
the right coordinate of the fit area, if applicable
-
top
private float top
the top coordinate of the fit area, if applicable
-
bottom
private float bottom
the bottom coordinate of the fit area, if applicable
-
zoom
private float zoom
the zoom, if applicable
-
-
Constructor Detail
-
PDFDestination
protected PDFDestination(PDFObject pageObj, int type)
Creates a new instance of PDFDestination- Parameters:
pageObj- the page object this destination refers totype- the type of page this object refers to
-
-
Method Detail
-
getDestination
public static PDFDestination getDestination(PDFObject obj, PDFObject root) throws java.io.IOException
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:
java.io.IOException
-
getType
public int getType()
Get the type of this destination
-
getPage
public PDFObject 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
private static PDFObject getDestFromName(PDFObject name, PDFObject root) throws java.io.IOException
Get a destination, given a name. This means the destination is in the root node's dests dictionary.- Throws:
java.io.IOException
-
-