1 31 package org.pdfbox.pdmodel.interactive.documentnavigation.destination; 32 33 import org.pdfbox.cos.COSArray; 34 import org.pdfbox.cos.COSBase; 35 36 43 public class PDPageFitWidthDestination extends PDPageDestination 44 { 45 46 49 protected static final String TYPE = "FitH"; 50 53 protected static final String TYPE_BOUNDED = "FitBH"; 54 55 59 public PDPageFitWidthDestination() 60 { 61 super(); 62 array.growToSize(3); 63 array.setName( 1, TYPE ); 64 65 } 66 67 72 public PDPageFitWidthDestination( COSArray arr ) 73 { 74 super( arr ); 75 } 76 77 78 84 public int getTop() 85 { 86 return array.getInt( 2 ); 87 } 88 89 94 public void setTop( int y ) 95 { 96 array.growToSize( 3 ); 97 if( y == -1 ) 98 { 99 array.set( 2, (COSBase)null ); 100 } 101 else 102 { 103 array.setInt( 2, y ); 104 } 105 } 106 107 112 public boolean fitBoundingBox() 113 { 114 return TYPE_BOUNDED.equals( array.getName( 1 ) ); 115 } 116 117 122 public void setFitBoundingBox( boolean fitBoundingBox ) 123 { 124 array.growToSize( 2 ); 125 if( fitBoundingBox ) 126 { 127 array.setName( 1, TYPE_BOUNDED ); 128 } 129 else 130 { 131 array.setName( 1, TYPE ); 132 } 133 } 134 } 135 | Popular Tags |