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 48 public class PresentationTextDescriptor extends AbstractAFPObject { 49 50 private int _width = 0; 51 private int _height = 0; 52 53 59 public PresentationTextDescriptor(int width, int height) { 60 61 _width = width; 62 _height = height; 63 64 } 65 66 71 public void writeDataStream(OutputStream os) 72 throws IOException { 73 74 byte[] data = new byte[] { 75 0x5A, 76 0x00, 77 0x16, 78 (byte) 0xD3, 79 (byte) 0xB1, 80 (byte) 0x9B, 81 0x00, 82 0x00, 83 0x00, 84 0x00, 85 0x00, 86 0x09, 87 0x60, 88 0x09, 89 0x60, 90 0x00, 91 0x00, 92 0x00, 93 0x00, 94 0x00, 95 0x00, 96 0x00, 97 0x00, 98 }; 99 100 byte[] x = BinaryUtils.convert(_width, 3); 101 data[15] = x[0]; 102 data[16] = x[1]; 103 data[17] = x[2]; 104 105 byte[] y = BinaryUtils.convert(_height, 3); 106 data[18] = y[0]; 107 data[19] = y[1]; 108 data[20] = y[2]; 109 110 os.write(data); 111 112 } 113 114 } | Popular Tags |