Class PDPageDestination
- java.lang.Object
-
- com.tom_roush.pdfbox.pdmodel.interactive.documentnavigation.destination.PDDestination
-
- com.tom_roush.pdfbox.pdmodel.interactive.documentnavigation.destination.PDPageDestination
-
- All Implemented Interfaces:
COSObjectable,PDDestinationOrAction
- Direct Known Subclasses:
PDPageFitDestination,PDPageFitHeightDestination,PDPageFitRectangleDestination,PDPageFitWidthDestination,PDPageXYZDestination
public abstract class PDPageDestination extends PDDestination
This represents a destination to a page, see subclasses for specific parameters.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPDPageDestination()Constructor to create empty page destination.protectedPDPageDestination(COSArray arr)Constructor to create empty page destination.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intfindPageNumber()Deprecated.This method has inconsistent behavior (see returns), useretrievePageNumber()instead.COSArraygetCOSObject()Convert this standard java object to a COS object.PDPagegetPage()This will get the page for this destination.intgetPageNumber()This will get the page number for this destination.intretrievePageNumber()Returns the page number for this destination, regardless of whether this is a page number or a reference to a page.voidsetPage(PDPage page)Set the page for this destination.voidsetPageNumber(int pageNumber)Set the page number for this destination.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from class com.tom_roush.pdfbox.pdmodel.interactive.documentnavigation.destination.PDDestination
create
-
-
-
-
Field Detail
-
array
protected COSArray array
Storage for the page destination.
-
-
Constructor Detail
-
PDPageDestination
protected PDPageDestination()
Constructor to create empty page destination.
-
PDPageDestination
protected PDPageDestination(COSArray arr)
Constructor to create empty page destination.- Parameters:
arr- A page destination array.
-
-
Method Detail
-
getPage
public PDPage getPage()
This will get the page for this destination. A page destination can either reference a page (for a local destination) or a page number (when doing a remote destination to another PDF). If this object is referencing by page number then this method will return null and should be used.- Returns:
- The page for this destination.
-
setPage
public void setPage(PDPage page)
Set the page for this destination.- Parameters:
page- The page for the destination.
-
getPageNumber
public int getPageNumber()
This will get the page number for this destination. A page destination can either reference a page (for a local destination) or a page number (when doing a remote destination to another PDF). If this object is referencing by page number then this method will return that number, otherwise -1 will be returned.- Returns:
- The zero-based page number for this destination.
-
findPageNumber
@Deprecated public int findPageNumber()
Deprecated.This method has inconsistent behavior (see returns), useretrievePageNumber()instead.Returns the page number for this destination, regardless of whether this is a page number or a reference to a page.- Returns:
- page number, or -1 if the destination type is unknown. The page number is 0-based if it was in the dictionary (for remote destinations), and 1-based if it was computed from a page reference (for local destinations).
- Since:
- Apache PDFBox 1.0.0
- See Also:
PDOutlineItem
-
retrievePageNumber
public int retrievePageNumber()
Returns the page number for this destination, regardless of whether this is a page number or a reference to a page.- Returns:
- the 0-based page number, or -1 if the destination type is unknown.
- See Also:
PDOutlineItem
-
setPageNumber
public void setPageNumber(int pageNumber)
Set the page number for this destination.- Parameters:
pageNumber- The page for the destination.
-
getCOSObject
public COSArray getCOSObject()
Convert this standard java object to a COS object.- Returns:
- The cos object that matches this Java object.
-
-