1 22 package gnu.jpdf; 23 24 import java.io.*; 25 import java.util.*; 26 27 35 public class PDFPageList extends PDFObject 36 { 37 38 41 private Vector pages; 42 43 46 public PDFPageList() { 47 super("/Pages"); 48 pages = new Vector(); 49 } 50 51 56 public void add(PDFPage page) { 57 pages.addElement(page); 58 59 page.pdfPageList = this; 61 } 62 63 68 public PDFPage getPage(int page) { 69 return (PDFPage)(pages.elementAt(page)); 70 } 71 72 76 public void write(OutputStream os) throws IOException { 77 writeStart(os); 79 80 82 os.write("/Kids ".getBytes()); 84 os.write(PDFObject.toArray(pages).getBytes()); 85 os.write("\n".getBytes()); 86 87 os.write("/Count ".getBytes()); 89 os.write(Integer.toString(pages.size()).getBytes()); 90 os.write("\n".getBytes()); 91 92 writeEnd(os); 94 } 95 96 } | Popular Tags |