| 1 |
package org.freehep.graphicsio.pdf; |
| 2 |
|
| 3 |
import java.io.IOException; |
| 4 |
import java.util.Vector; |
| 5 |
|
| 6 |
/** |
| 7 |
* Implements the Page Tree Node (see Table 3.16). |
| 8 |
* <p> |
| 9 |
* |
| 10 |
* @author Mark Donszelmann |
| 11 |
* @version $Id: freehep-graphicsio-pdf/src/main/java/org/freehep/graphicsio/pdf/PDFPageTree.java f493ff6e61b2 2005/12/01 18:46:43 duns $ |
| 12 |
*/ |
| 13 |
public class PDFPageTree extends PDFPageBase { |
| 14 |
|
| 15 |
Vector<PDFRef> pages = new Vector<PDFRef>(); |
| 16 |
|
| 17 |
PDFPageTree(PDF pdf, PDFByteWriter writer, PDFObject object, PDFRef parent) |
| 18 |
throws IOException { |
| 19 |
super(pdf, writer, object, parent); |
| 20 |
entry("Type", pdf.name("Pages")); |
| 21 |
} |
| 22 |
|
| 23 |
public void addPage(String name) { |
| 24 |
pages.add(pdf.ref(name)); |
| 25 |
} |
| 26 |
|
| 27 |
void close() throws IOException { |
| 28 |
Object[] kids = new Object[pages.size()]; |
| 29 |
pages.copyInto(kids); |
| 30 |
entry("Kids", kids); |
| 31 |
entry("Count", kids.length); |
| 32 |
super.close(); |
| 33 |
} |
| 34 |
} |