1 51 package org.apache.fop.pdf; 52 53 import java.io.IOException ; 55 import java.io.OutputStream ; 56 57 64 public abstract class PDFObject { 65 66 69 protected int number; 70 71 74 protected int generation = 0; 75 76 81 public PDFObject(int number) { 82 this.number = number; 83 } 84 85 public PDFObject() { 86 } 88 89 92 public int getNumber() { 93 return this.number; 94 } 95 96 102 protected int output(OutputStream stream) throws IOException { 103 byte[] pdf = this.toPDF(); 104 stream.write(pdf); 105 return pdf.length; 106 } 107 108 113 public String referencePDF() { 114 String p = this.number + " " + this.generation + " R"; 115 return p; 116 } 117 118 123 abstract byte[] toPDF(); 124 } 125 | Popular Tags |