org.pdfbox.pdmodel.interactive.documentnavigation.destination

Class PDPageDestination

Implemented Interfaces:
COSObjectable, PDDestinationOrAction
Known Direct Subclasses:
PDPageFitDestination, PDPageFitHeightDestination, PDPageFitRectangleDestination, PDPageFitWidthDestination, PDPageXYZDestination

public abstract class PDPageDestination
extends PDDestination

This represents a destination to a page, see subclasses for specific parameters.
Version:
$Revision: 1.2 $
Author:
Ben Litchfield

Field Summary

protected COSArray
array
Storage for the page destination.

Constructor Summary

PDPageDestination()
Constructor to create empty page destination.
PDPageDestination(COSArray arr)
Constructor to create empty page destination.

Method Summary

COSArray
getCOSArray()
Convert this standard java object to a COS object.
COSBase
getCOSObject()
Convert this standard java object to a COS object.
PDPage
getPage()
This will get the page for this destination.
int
getPageNumber()
This will get the page number for this destination.
void
setPage(PDPage page)
Set the page for this destination.
void
setPageNumber(int pageNumber)
Set the page number for this destination.

Methods inherited from class org.pdfbox.pdmodel.interactive.documentnavigation.destination.PDDestination

create, toString

Field Details

array

protected COSArray array
Storage for the page destination.

Constructor Details

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 Details

getCOSArray

public COSArray getCOSArray()
Convert this standard java object to a COS object.
Returns:
The cos object that matches this Java object.

getCOSObject

public COSBase getCOSObject()
Convert this standard java object to a COS object.
Specified by:
getCOSObject in interface COSObjectable
Returns:
The cos object that matches this Java object.

getPage

public PDPage getPage()
This will get the page for this destination. A page destination can either reference a page 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 getPageNumber should be used.
Returns:
The page for this destination.

getPageNumber

public int getPageNumber()
This will get the page number for this destination. A page destination can either reference a page 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 page number for this destination.

setPage

public void setPage(PDPage page)
Set the page for this destination.
Parameters:
page - The page for the destination.

setPageNumber

public void setPageNumber(int pageNumber)
Set the page number for this destination.
Parameters:
pageNumber - The page for the destination.