1 50 51 package com.lowagie.text.pdf; 52 import java.io.IOException ; 53 import java.io.OutputStream ; 54 55 public class PRIndirectReference extends PdfIndirectReference { 56 57 protected PdfReader reader; 58 60 62 69 70 PRIndirectReference(PdfReader reader, int number, int generation) { 71 type = INDIRECT; 72 this.number = number; 73 this.generation = generation; 74 this.reader = reader; 75 } 76 77 83 84 PRIndirectReference(PdfReader reader, int number) { 85 this(reader, number, 0); 86 } 87 88 90 public void toPdf(PdfWriter writer, OutputStream os) throws IOException { 91 int n = writer.getNewObjectNumber(reader, number, generation); 92 os.write(PdfEncodings.convertToBytes(new StringBuffer ().append(n).append(" 0 R").toString(), null)); 93 } 94 95 public PdfReader getReader() { 96 return reader; 97 } 98 99 public void setNumber(int number, int generation) { 100 this.number = number; 101 this.generation = generation; 102 } 103 } | Popular Tags |