1 51 package org.apache.fop.pdf; 52 53 import java.io.UnsupportedEncodingException ; 55 56 61 public class PDFRectangle { 62 63 66 protected int llx; 67 68 71 protected int lly; 72 73 76 protected int urx; 77 78 81 protected int ury; 82 83 91 public PDFRectangle(int llx, int lly, int urx, int ury) { 92 this.llx = llx; 93 this.lly = lly; 94 this.urx = urx; 95 this.ury = ury; 96 } 97 98 103 public PDFRectangle(int[] array) { 104 this.llx = array[0]; 105 this.lly = array[1]; 106 this.urx = array[2]; 107 this.ury = array[3]; 108 } 109 110 115 public byte[] toPDF() { 116 try { 117 return toPDFString().getBytes(PDFDocument.ENCODING); 118 } catch (UnsupportedEncodingException ue) { 119 return toPDFString().getBytes(); 120 } 121 } 122 123 public String toPDFString() { 124 return new String (" [" + llx + " " + lly + " " + urx + " " + ury 125 + "] "); 126 } 127 128 } 129 | Popular Tags |