1 19 20 package jxl.read.biff; 21 22 import jxl.biff.Type; 23 import jxl.biff.IntegerHelper; 24 import jxl.biff.RecordData; 25 import jxl.biff.DoubleHelper; 26 27 30 public class SetupRecord extends RecordData 31 { 32 35 private byte[] data; 36 37 40 private boolean portraitOrientation; 41 42 45 private double headerMargin; 46 47 50 private double footerMargin; 51 52 55 private int paperSize; 56 57 60 private int scaleFactor; 61 62 65 private int pageStart; 66 67 70 private int fitWidth; 71 72 75 private int fitHeight; 76 77 80 private int horizontalPrintResolution; 81 82 85 private int verticalPrintResolution; 86 87 90 private int copies; 91 92 97 SetupRecord(Record t) 98 { 99 super(Type.SETUP); 100 101 data = t.getData(); 102 103 paperSize = IntegerHelper.getInt(data[0], data[1]); 104 scaleFactor = IntegerHelper.getInt(data[2], data[3]); 105 pageStart = IntegerHelper.getInt(data[4], data[5]); 106 fitWidth = IntegerHelper.getInt(data[6], data[7]); 107 fitHeight = IntegerHelper.getInt(data[8], data[9]); 108 horizontalPrintResolution = IntegerHelper.getInt(data[12], data[13]); 109 verticalPrintResolution = IntegerHelper.getInt(data[14], data[15]); 110 copies = IntegerHelper.getInt(data[32], data[33]); 111 112 headerMargin = DoubleHelper.getIEEEDouble(data, 16); 113 footerMargin = DoubleHelper.getIEEEDouble(data, 24); 114 115 116 117 int grbit = IntegerHelper.getInt(data[10], data[11]); 118 portraitOrientation = ((grbit & 0x02) != 0); 119 } 120 121 126 public boolean isPortrait() 127 { 128 return portraitOrientation; 129 } 130 131 136 public double getHeaderMargin() 137 { 138 return headerMargin; 139 } 140 141 146 public double getFooterMargin() 147 { 148 return footerMargin; 149 } 150 151 156 public int getPaperSize() 157 { 158 return paperSize; 159 } 160 161 166 public int getScaleFactor() 167 { 168 return scaleFactor; 169 } 170 171 176 public int getPageStart() 177 { 178 return pageStart; 179 } 180 181 186 public int getFitWidth() 187 { 188 return fitWidth; 189 } 190 191 196 public int getFitHeight() 197 { 198 return fitHeight; 199 } 200 201 206 public int getHorizontalPrintResolution() 207 { 208 return horizontalPrintResolution; 209 } 210 211 216 public int getVerticalPrintResolution() 217 { 218 return verticalPrintResolution; 219 } 220 221 226 public int getCopies() 227 { 228 return copies; 229 } 230 } 231 | Popular Tags |