1 17 18 19 20 package org.apache.fop.render.afp.modca; 21 22 import java.io.IOException ; 23 import java.io.OutputStream ; 24 import org.apache.fop.render.afp.tools.BinaryUtils; 25 26 31 public class PageDescriptor extends AbstractAFPObject { 32 33 private int _width = 0; 34 private int _height = 0; 35 36 42 public PageDescriptor(int width, int height) { 43 44 _width = width; 45 _height = height; 46 47 } 48 49 54 public void writeDataStream(OutputStream os) 55 throws IOException { 56 57 byte[] data = new byte[] { 58 0x5A, 59 0x00, 60 0x17, 61 (byte) 0xD3, 62 (byte) 0xA6, 63 (byte) 0xAF, 64 0x00, 65 0x00, 66 0x00, 67 0x00, 68 0x00, 69 0x09, 70 0x60, 71 0x09, 72 0x60, 73 0x00, 74 0x00, 75 0x00, 76 0x00, 77 0x00, 78 0x00, 79 0x00, 80 0x00, 81 0x00, 82 }; 83 84 byte[] x = BinaryUtils.convert(_width, 3); 85 data[15] = x[0]; 86 data[16] = x[1]; 87 data[17] = x[2]; 88 89 byte[] y = BinaryUtils.convert(_height, 3); 90 data[18] = y[0]; 91 data[19] = y[1]; 92 data[20] = y[2]; 93 94 os.write(data); 95 96 } 97 98 } | Popular Tags |