/** * This will return the total page count of the PDF document. * * @return The total number of pages in the PDF document. */publicint getNumberOfPages()
{
returngetDocumentCatalog().getPages().getCount();
}

/** * Set the named destinations that are associated with this document. * * @param dests The destination names. */publicvoid setDests( PDDestinationNameTreeNode dests )
{
nameDictionary.setItem( COSName.DESTS, dests );
//The dests can either be in the document catalog or in the//names dictionary, PDFBox will just maintain the one in the//names dictionary for now unless there is a reason to do//something else.//clear the potentially out of date Dests reference. catalog.getCOSObject().setItem( COSName.DESTS, (COSObjectable)null);
}