Example usage for com.itextpdf.text.pdf PdfOutline PdfOutline

List of usage examples for com.itextpdf.text.pdf PdfOutline PdfOutline

Introduction

In this page you can find the example usage for com.itextpdf.text.pdf PdfOutline PdfOutline.

Prototype


public PdfOutline(PdfOutline parent, PdfDestination destination, Paragraph title) 

Source Link

Document

Constructs a PdfOutline.

Usage

From source file:net.atomique.ksar.export.FilePDF.java

License:Open Source License

private void export_treenode(SortedTreeNode node, PdfOutline root) {
    int num = node.getChildCount();
    if (num > 0) {
        Object obj1 = node.getUserObject();
        if (obj1 instanceof ParentNodeInfo) {
            ParentNodeInfo tmpnode = (ParentNodeInfo) obj1;
            List nodeobj = tmpnode.getNode_object();
            if (nodeobj.isPrintSelected()) {
                root = new PdfOutline(root, new PdfDestination(PdfDestination.FIT), nodeobj.getTitle());
            }/*from  ww w .ja va 2 s . co  m*/
        }
        for (int i = 0; i < num; i++) {
            SortedTreeNode l = (SortedTreeNode) node.getChildAt(i);
            export_treenode(l, root);
        }
    } else {
        Object obj1 = node.getUserObject();
        if (obj1 instanceof TreeNodeInfo) {
            TreeNodeInfo tmpnode = (TreeNodeInfo) obj1;
            Graph nodeobj = tmpnode.getNode_object();
            if (nodeobj.isPrintSelected()) {
                new PdfOutline(root, new PdfDestination(PdfDestination.FIT), nodeobj.getTitle());
                update_ui();
                addchart(writer, nodeobj);
                document.newPage();

            }
        }
    }
}