1 51 package org.apache.fop.pdf; 52 53 import java.io.UnsupportedEncodingException ; 55 56 59 public class PDFArray extends PDFObject { 60 61 protected int[] values; 62 63 69 public PDFArray(int number, int[] values) { 70 71 72 super(number); 73 74 75 this.values = values; 76 } 77 78 83 public byte[] toPDF() { 84 StringBuffer p = new StringBuffer (); 85 p.append(this.number + " " + this.generation + " obj\n["); 86 for (int i = 0; i < values.length; i++) { 87 p.append(" "); 88 p.append(values[i]); 89 } 90 p.append("]\nendobj\n"); 91 92 try { 93 return p.toString().getBytes(PDFDocument.ENCODING); 94 } catch (UnsupportedEncodingException ue) { 95 return p.toString().getBytes(); 96 } 97 } 98 99 } 100 | Popular Tags |