1 50 51 package com.lowagie.text.rtf.document; 52 53 import com.lowagie.text.rtf.document.output.RtfDataCache; 54 import com.lowagie.text.rtf.style.RtfParagraphStyle; 55 56 57 66 public class RtfDocumentSettings { 67 68 71 private RtfDocument document = null; 72 75 private boolean outputTableRowDefinitionAfter = true; 76 79 private boolean outputDebugLineBreaks = true; 80 83 private boolean alwaysGenerateSoftLinebreaks = false; 84 87 private boolean alwaysUseUnicode = true; 88 91 private int dataCacheStyle = RtfDataCache.CACHE_MEMORY; 92 95 private boolean writeImageScalingInformation = false; 96 99 private boolean imagePDFConformance = true; 100 101 106 public RtfDocumentSettings(RtfDocument document) { 107 this.document = document; 108 } 109 110 115 public boolean isOutputDebugLineBreaks() { 116 return outputDebugLineBreaks; 117 } 118 119 125 public void setOutputDebugLineBreaks(boolean outputDebugLineBreaks) { 126 this.outputDebugLineBreaks = outputDebugLineBreaks; 127 } 128 129 134 public boolean isOutputTableRowDefinitionAfter() { 135 return outputTableRowDefinitionAfter; 136 } 137 138 145 public void setOutputTableRowDefinitionAfter( 146 boolean outputTableRowDefinitionAfter) { 147 this.outputTableRowDefinitionAfter = outputTableRowDefinitionAfter; 148 } 149 150 155 public boolean isAlwaysGenerateSoftLinebreaks() { 156 return this.alwaysGenerateSoftLinebreaks; 157 } 158 159 164 public void setAlwaysGenerateSoftLinebreaks(boolean alwaysGenerateSoftLinebreaks) { 165 this.alwaysGenerateSoftLinebreaks = alwaysGenerateSoftLinebreaks; 166 } 167 168 173 public boolean isAlwaysUseUnicode() { 174 return this.alwaysUseUnicode; 175 } 176 177 182 public void setAlwaysUseUnicode(boolean alwaysUseUnicode) { 183 this.alwaysUseUnicode = alwaysUseUnicode; 184 } 185 186 192 public void registerParagraphStyle(RtfParagraphStyle rtfParagraphStyle) { 193 this.document.getDocumentHeader().registerParagraphStyle(rtfParagraphStyle); 194 } 195 196 212 public void setDataCacheStyle(int dataCacheStyle) { 213 switch(dataCacheStyle) { 214 case RtfDataCache.CACHE_MEMORY_EFFICIENT: 215 this.dataCacheStyle = RtfDataCache.CACHE_MEMORY_EFFICIENT; 216 break; 217 case RtfDataCache.CACHE_DISK: 218 this.dataCacheStyle = RtfDataCache.CACHE_DISK; 219 break; 220 default: 221 case RtfDataCache.CACHE_MEMORY: 222 this.dataCacheStyle = RtfDataCache.CACHE_MEMORY; 223 break; 224 } 225 } 226 227 232 public int getDataCacheStyle() { 233 return this.dataCacheStyle; 234 } 235 236 237 242 public boolean isImagePDFConformance() { 243 return this.imagePDFConformance; 244 } 245 246 247 255 public void setImagePDFConformance(boolean imagePDFConformance) { 256 this.imagePDFConformance = imagePDFConformance; 257 } 258 259 260 265 public boolean isWriteImageScalingInformation() { 266 return this.writeImageScalingInformation; 267 } 268 269 270 276 public void setWriteImageScalingInformation(boolean writeImageScalingInformation) { 277 this.writeImageScalingInformation = writeImageScalingInformation; 278 } 279 280 285 public void setOptionsForMSWord2000And97() { 286 this.setOutputTableRowDefinitionAfter(true); 287 this.setWriteImageScalingInformation(true); 288 } 289 290 294 public void setOptionsForMSWordForMac() { 295 this.setWriteImageScalingInformation(true); 296 } 297 298 302 public void setOptionsForMSWordXP() { 303 this.setWriteImageScalingInformation(false); 304 } 305 306 311 public void setOptionsForOpenOfficeOrg() { 312 this.setOutputTableRowDefinitionAfter(false); 313 } 314 } 315 | Popular Tags |