1 31 package org.pdfbox.pdmodel.common; 32 33 import org.pdfbox.cos.COSBase; 34 import org.pdfbox.cos.COSName; 35 36 43 public class PDNamedTextStream implements DualCOSObjectable 44 { 45 private COSName streamName; 46 private PDTextStream stream; 47 48 51 public PDNamedTextStream() 52 { 53 } 55 56 62 public PDNamedTextStream( COSName name, COSBase str ) 63 { 64 streamName = name; 65 stream = PDTextStream.createTextStream( str ); 66 } 67 68 73 public String getName() 74 { 75 String name = null; 76 if( streamName != null ) 77 { 78 name = streamName.getName(); 79 } 80 return name; 81 } 82 83 88 public void setName( String name ) 89 { 90 streamName = COSName.getPDFName( name ); 91 } 92 93 98 public PDTextStream getStream() 99 { 100 return stream; 101 } 102 103 108 public void setStream( PDTextStream str ) 109 { 110 stream = str; 111 } 112 113 118 public COSBase getFirstCOSObject() 119 { 120 return streamName; 121 } 122 123 128 public COSBase getSecondCOSObject() 129 { 130 COSBase retval = null; 131 if( stream != null ) 132 { 133 retval = stream.getCOSObject(); 134 } 135 return retval; 136 } 137 } | Popular Tags |