1 31 package org.pdfbox.pdmodel; 32 33 import java.io.IOException ; 34 35 import org.pdfbox.cos.COSBase; 36 import org.pdfbox.cos.COSDictionary; 37 import org.pdfbox.pdmodel.common.PDNameTreeNode; 38 import org.pdfbox.pdmodel.interactive.documentnavigation.destination.PDDestination; 39 import org.pdfbox.pdmodel.interactive.documentnavigation.destination.PDPageDestination; 40 41 47 public class PDDestinationNameTreeNode extends PDNameTreeNode 48 { 49 52 public PDDestinationNameTreeNode() 53 { 54 super( PDPageDestination.class ); 55 } 56 57 62 public PDDestinationNameTreeNode( COSDictionary dic ) 63 { 64 super( dic, PDPageDestination.class ); 65 } 66 67 70 protected Object convertCOSToPD( COSBase base ) throws IOException 71 { 72 COSBase destination = base; 73 if( base instanceof COSDictionary ) 74 { 75 destination = ((COSDictionary)base).getDictionaryObject( "D" ); 79 } 80 return PDDestination.create( destination ); 81 } 82 83 86 protected PDNameTreeNode createChildNode( COSDictionary dic ) 87 { 88 return new PDDestinationNameTreeNode(dic); 89 } 90 } | Popular Tags |