1 31 package org.pdfbox.pdmodel.interactive.annotation; 32 33 import org.pdfbox.cos.COSDictionary; 34 35 import org.pdfbox.pdmodel.common.PDTextStream; 36 import org.pdfbox.cos.COSBase; 37 38 import java.io.IOException ; 39 40 import java.util.Calendar ; 41 42 49 public abstract class PDAnnotationMarkup extends PDAnnotation 50 { 51 52 56 57 60 public static final String RT_REPLY = "R"; 61 62 65 public static final String RT_GROUP = "Group"; 66 67 70 public PDAnnotationMarkup() 71 { 72 super(); 73 } 74 75 81 public PDAnnotationMarkup( COSDictionary dict ) 82 { 83 super( dict ); 84 } 85 86 92 public String getTitlePopup() 93 { 94 return getDictionary().getString( "T" ); 95 } 96 97 104 public void setTitlePopup( String t ) 105 { 106 getDictionary().setString( "T", t ); 107 } 108 109 115 public PDAnnotationPopup getPopup() 116 { 117 COSDictionary popup = (COSDictionary) getDictionary().getDictionaryObject( "Popup" ); 118 if (popup != null) 119 { 120 return new PDAnnotationPopup( popup ); 121 } 122 else 123 { 124 return null; 125 } 126 } 127 128 135 public void setPopup( PDAnnotationPopup popup ) 136 { 137 getDictionary().setItem( "Popup", popup ); 138 } 139 140 146 public float getConstantOpacity() 147 { 148 return getDictionary().getFloat( "CA", 1 ); 149 } 150 151 158 public void setConstantOpacity( float ca ) 159 { 160 getDictionary().setFloat( "CA", ca ); 161 } 162 163 169 public PDTextStream getRichContents() 170 { 171 COSBase rc = getDictionary().getDictionaryObject( "RC" ); 172 if (rc != null) 173 { 174 return PDTextStream.createTextStream( rc ); 175 } 176 else 177 { 178 return null; 179 } 180 } 181 182 188 public void setRichContents( PDTextStream rc ) 189 { 190 getDictionary().setItem( "RC", rc); 191 } 192 193 200 public Calendar getCreationDate() throws IOException 201 { 202 return getDictionary().getDate( "CreationDate" ); 203 } 204 205 211 public void setCreationDate( Calendar creationDate ) 212 { 213 getDictionary().setDate( "CreationDate", creationDate ); 214 } 215 216 224 public PDAnnotation getInReplyTo() throws IOException 225 { 226 COSBase irt = getDictionary().getDictionaryObject( "IRT" ); 227 return PDAnnotation.createAnnotation( irt ); 228 } 229 230 237 public void setInReplyTo( PDAnnotation irt ) 238 { 239 getDictionary().setItem( "IRT", irt ); 240 } 241 242 247 public String getSubject() 248 { 249 return getDictionary().getString( "Subj" ); 250 } 251 252 258 public void setSubject( String subj ) 259 { 260 getDictionary().setString( "Subj", subj ); 261 } 262 263 269 public String getReplyType() 270 { 271 return getDictionary().getNameAsString( "RT", RT_REPLY ); 272 } 273 274 281 public void setReplyType( String rt ) 282 { 283 getDictionary().setName( "RT", rt ); 284 } 285 286 293 public String getIntent() 294 { 295 return getDictionary().getNameAsString( "IT" ); 296 } 297 298 306 public void setIntent( String it ) 307 { 308 getDictionary().setName( "IT", it ); 309 } 310 311 } | Popular Tags |