System.out.println("Named destinations found (" + namedDestinations.getContainer().getReference() + ")");
// Parsing the named destinations...
for(Map.Entry<PdfString,Destination> namedDestination : namedDestinations.entrySet())
{
PdfString key = namedDestination.getKey();
Destination value = namedDestination.getValue();
System.out.println("Destination '" + key.getValue() + "' (" + value.getContainer().getReference() + ")");
System.out.print(" Target Page: number = ");
Object pageRef = value.getPageRef();
if(pageRef instanceof Integer) // NOTE: numeric page refs are typical of remote destinations.
{System.out.println(((Integer)pageRef) + 1);}