1 51 package org.apache.fop.pdf; 52 53 import java.io.UnsupportedEncodingException ; 55 import java.util.ArrayList ; 56 57 63 public class PDFAnnotList extends PDFObject { 64 65 68 protected ArrayList links = new ArrayList (); 69 70 73 protected int count = 0; 74 75 80 public PDFAnnotList(int number) { 81 82 83 super(number); 84 } 85 86 91 public void addLink(PDFLink link) { 92 this.links.add(link); 93 this.count++; 94 } 95 96 101 public int getCount() { 102 return this.count; 103 } 104 105 110 public byte[] toPDF() { 111 StringBuffer p = new StringBuffer (this.number + " " + this.generation 112 + " obj\n[\n"); 113 for (int i = 0; i < this.count; i++) { 114 p = p.append(((PDFObject)links.get(i)).referencePDF() 115 + "\n"); 116 } 117 p = p.append("]\nendobj\n"); 118 119 try { 120 return p.toString().getBytes(PDFDocument.ENCODING); 121 } catch (UnsupportedEncodingException ue) { 122 return p.toString().getBytes(); 123 } 124 } 125 126 134 } 135 | Popular Tags |