List of usage examples for org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination PDNamedDestination getNamedDestination
public String getNamedDestination()
From source file:org.pdfmetamodifier.OutlineHelper.java
License:Apache License
private static Integer getDestinationPageNumber(final PDDestination destination, final PDPageTree pages, final PDDestinationNameTreeNode destinations) throws IOException { if (destination != null) { if (destination instanceof PDPageDestination) { final PDPageDestination pageDestination = (PDPageDestination) destination; return getOutlinesPageNumber(pageDestination, pages); }//from w w w .j a v a 2s . c o m if (destination instanceof PDNamedDestination) { final PDNamedDestination namedDestination = (PDNamedDestination) destination; final PDPageDestination pageDestination = destinations .getValue(namedDestination.getNamedDestination()); return getOutlinesPageNumber(pageDestination, pages); } // Should not happens. throw new RuntimeException(String.format("Unsupported type of bookmark destination: %s!", destination.getClass().getName())); } return null; }