1 16 17 18 package org.apache.poi.hssf.usermodel; 19 20 import org.apache.poi.hssf.record.PrintSetupRecord; 21 22 38 public class HSSFPrintSetup extends Object { 39 public static final short LETTER_PAPERSIZE = 1; 40 public static final short LEGAL_PAPERSIZE = 5; 41 public static final short EXECUTIVE_PAPERSIZE = 7; 42 public static final short A4_PAPERSIZE = 9; 43 public static final short A5_PAPERSIZE = 11; 44 public static final short ENVELOPE_10_PAPERSIZE = 20; 45 public static final short ENVELOPE_DL_PAPERSIZE = 27; 46 public static final short ENVELOPE_CS_PAPERSIZE = 28; 47 public static final short ENVELOPE_MONARCH_PAPERSIZE = 37; 48 PrintSetupRecord printSetupRecord; 49 50 54 protected HSSFPrintSetup(PrintSetupRecord printSetupRecord) { 55 this.printSetupRecord = printSetupRecord; 56 } 57 58 62 public void setPaperSize(short size) { 63 printSetupRecord.setPaperSize(size); 64 } 65 66 70 public void setScale(short scale) { 71 printSetupRecord.setScale(scale); 72 } 73 74 78 public void setPageStart(short start) { 79 printSetupRecord.setPageStart(start); 80 } 81 82 86 public void setFitWidth(short width) { 87 printSetupRecord.setFitWidth(width); 88 } 89 90 94 public void setFitHeight(short height) { 95 printSetupRecord.setFitHeight(height); 96 } 97 98 102 public void setOptions(short options) { 103 printSetupRecord.setOptions(options); 104 } 105 106 110 public void setLeftToRight(boolean ltor) { 111 printSetupRecord.setLeftToRight(ltor); 112 } 113 114 118 public void setLandscape(boolean ls) { 119 printSetupRecord.setLandscape(!ls); 120 } 121 122 126 public void setValidSettings(boolean valid) { 127 printSetupRecord.setValidSettings(valid); 128 } 129 130 134 public void setNoColor(boolean mono) { 135 printSetupRecord.setNoColor(mono); 136 } 137 138 142 public void setDraft(boolean d) { 143 printSetupRecord.setDraft(d); 144 } 145 146 150 public void setNotes(boolean printnotes) { 151 printSetupRecord.setNotes(printnotes); 152 } 153 154 158 public void setNoOrientation(boolean orientation) { 159 printSetupRecord.setNoOrientation(orientation); 160 } 161 162 166 public void setUsePage(boolean page) { 167 printSetupRecord.setUsePage(page); 168 } 169 170 174 public void setHResolution(short resolution) { 175 printSetupRecord.setHResolution(resolution); 176 } 177 178 182 public void setVResolution(short resolution) { 183 printSetupRecord.setVResolution(resolution); 184 } 185 186 190 public void setHeaderMargin(double headermargin) { 191 printSetupRecord.setHeaderMargin(headermargin); 192 } 193 194 198 public void setFooterMargin(double footermargin) { 199 printSetupRecord.setFooterMargin(footermargin); 200 } 201 202 206 public void setCopies(short copies) { 207 printSetupRecord.setCopies(copies); 208 } 209 210 214 public short getPaperSize() { 215 return printSetupRecord.getPaperSize(); 216 } 217 218 222 public short getScale() { 223 return printSetupRecord.getScale(); 224 } 225 226 230 public short getPageStart() { 231 return printSetupRecord.getPageStart(); 232 } 233 234 238 public short getFitWidth() { 239 return printSetupRecord.getFitWidth(); 240 } 241 242 246 public short getFitHeight() { 247 return printSetupRecord.getFitHeight(); 248 } 249 250 254 public short getOptions() { 255 return printSetupRecord.getOptions(); 256 } 257 258 262 public boolean getLeftToRight() { 263 return printSetupRecord.getLeftToRight(); 264 } 265 266 270 public boolean getLandscape() { 271 return !printSetupRecord.getLandscape(); 272 } 273 274 278 public boolean getValidSettings() { 279 return printSetupRecord.getValidSettings(); 280 } 281 282 286 public boolean getNoColor() { 287 return printSetupRecord.getNoColor(); 288 } 289 290 294 public boolean getDraft() { 295 return printSetupRecord.getDraft(); 296 } 297 298 302 public boolean getNotes() { 303 return printSetupRecord.getNotes(); 304 } 305 306 310 public boolean getNoOrientation() { 311 return printSetupRecord.getNoOrientation(); 312 } 313 314 318 public boolean getUsePage() { 319 return printSetupRecord.getUsePage(); 320 } 321 322 326 public short getHResolution() { 327 return printSetupRecord.getHResolution(); 328 } 329 330 334 public short getVResolution() { 335 return printSetupRecord.getVResolution(); 336 } 337 338 342 public double getHeaderMargin() { 343 return printSetupRecord.getHeaderMargin(); 344 } 345 346 350 public double getFooterMargin() { 351 return printSetupRecord.getFooterMargin(); 352 } 353 354 358 public short getCopies() { 359 return printSetupRecord.getCopies(); 360 } 361 } | Popular Tags |