1 31 package org.pdfbox.pdmodel.interactive.annotation; 32 33 import org.pdfbox.cos.COSDictionary; 34 import org.pdfbox.cos.COSArray; 35 import org.pdfbox.cos.COSName; 36 37 44 public class PDAnnotationTextMarkup extends PDAnnotationMarkup 45 { 46 47 50 public static final String SUB_TYPE_HIGHLIGHT = "Highlight"; 51 54 public static final String SUB_TYPE_UNDERLINE = "Underline"; 55 58 public static final String SUB_TYPE_SQUIGGLY = "Squiggly"; 59 62 public static final String SUB_TYPE_STRIKEOUT = "StrikeOut"; 63 64 65 private PDAnnotationTextMarkup() 66 { 67 } 69 70 75 public PDAnnotationTextMarkup(String subType) 76 { 77 super(); 78 setSubtype( subType ); 79 80 setQuadPoints( new float[0] ); 82 } 83 84 90 public PDAnnotationTextMarkup( COSDictionary field ) 91 { 92 super( field ); 93 } 94 95 102 public void setQuadPoints( float[] quadPoints ) 103 { 104 COSArray newQuadPoints = new COSArray(); 105 newQuadPoints.setFloatArray( quadPoints ); 106 getDictionary().setItem( "QuadPoints", newQuadPoints ); 107 } 108 109 115 public float[] getQuadPoints() 116 { 117 COSArray quadPoints = (COSArray) getDictionary().getDictionaryObject( "QuadPoints" ); 118 if (quadPoints != null) 119 { 120 return quadPoints.toFloatArray(); 121 } 122 else 123 { 124 return null; } 126 } 127 128 134 public void setSubtype( String subType ) 135 { 136 getDictionary().setName( COSName.SUBTYPE, subType ); 137 } 138 139 145 public String getSubtype() 146 { 147 return getDictionary().getNameAsString( COSName.SUBTYPE); 148 } 149 150 151 } | Popular Tags |