Top Description Fields Constructors Methods
org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination

public abstract Class PDPageDestination

extends PDDestination
Class Inheritance
Known Direct Subclasses
org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDPageFitDestination, org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDPageFitHeightDestination, org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDPageFitRectangleDestination, org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDPageFitWidthDestination, org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDPageXYZDestination
Imports
org.apache.pdfbox.cos.COSArray, .COSBase, .COSDictionary, .COSName, .COSNumber, org.apache.pdfbox.pdmodel.PDPage, .PDPageTree

This represents a destination to a page, see subclasses for specific parameters.
Author
Ben Litchfield

Field Summary

Modifier and TypeField and Description
protected final COSArray
array

Storage for the page destination.

Constructor Summary

AccessConstructor and Description
protected
PDPageDestination()

Constructor to create empty page destination.

protected
PDPageDestination(COSArray
A page destination array.
arr
)

Constructor to create empty page destination.

Method Summary

Modifier and TypeMethod and Description
public COSArray

Returns:

The cos object that matches this Java object.
getCOSObject
()

Implements org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

Convert this standard java object to a COS object.

public PDPage

Returns:

The page for this destination.
getPage
()

This will get the page for this destination.

public int

Returns:

The zero-based page number for this destination.
getPageNumber
()

This will get the page number for this destination.

private int
public int

Returns:

the 0-based page number, or -1 if the destination type is unknown.
retrievePageNumber
()

Returns the page number for this destination, regardless of whether this is a page number or a reference to a page.

public void
setPage(PDPage
The page for a local destination.
page
)

Set the page for a local destination.

public void
setPageNumber(int
The page for a remote destination.
pageNumber
)

Set the page number for a remote destination.

Inherited from org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDDestination:
create

Field Detail

arrayback to summary
protected final COSArray array

Storage for the page destination.

Constructor Detail

PDPageDestinationback to summary
protected PDPageDestination()

Constructor to create empty page destination.

PDPageDestinationback to summary
protected PDPageDestination(COSArray arr)

Constructor to create empty page destination.

Parameters
arr:COSArray

A page destination array.

Method Detail

getCOSObjectback to summary
public COSArray getCOSObject()

Implements org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

Convert this standard java object to a COS object.

Returns:COSArray

The cos object that matches this Java object.

Annotations
@Override
getPageback to summary
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 getPageNumber() should be used.

Returns:PDPage

The page for this destination.

getPageNumberback to summary
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:int

The zero-based page number for this destination.

indexOfPageTreeback to summary
private int indexOfPageTree(COSDictionary pageDict)
retrievePageNumberback to summary
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:int

the 0-based page number, or -1 if the destination type is unknown.

See Also
org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem
setPageback to summary
public void setPage(PDPage page)

Set the page for a local destination. For an external destination, call setPageNumber(int pageNumber).

Parameters
page:PDPage

The page for a local destination.

setPageNumberback to summary
public void setPageNumber(int pageNumber)

Set the page number for a remote destination. For an internal destination, call setPage(PDPage page).

Parameters
pageNumber:int

The page for a remote destination.