Package com.lowagie.text.pdf

Examples of com.lowagie.text.pdf.PdfOutline


     */
    public void onParagraph(PdfWriter writer, Document document, float position) {
        n++;
        PdfContentByte cb = writer.getDirectContent();
        PdfDestination destination = new PdfDestination(PdfDestination.FITH, position);
        new PdfOutline(cb.getRootOutline(), destination, "paragraph " + n);
    }
View Full Code Here


            // step 4:
            // we add some content
            document.add(new Paragraph("Outline action example"));
            // we add the outline
            PdfContentByte cb = writer.getDirectContent();
            PdfOutline root = cb.getRootOutline();
            PdfOutline links = new PdfOutline(root, new PdfAction("http://www.lowagie.com/iText/links.html"), "Useful links");
            links.setColor(new Color(0x00, 0x80, 0x80));
            links.setStyle(Font.BOLD);
            new PdfOutline(links, new PdfAction("http://www.lowagie.com/iText"), "Bruno's iText site");
            new PdfOutline(links, new PdfAction("http://itextpdf.sourceforge.net/"), "Paulo's iText site");
            new PdfOutline(links, new PdfAction("http://sourceforge.net/projects/itext/"), "iText @ SourceForge");
            PdfOutline other = new PdfOutline(root, new PdfDestination(PdfDestination.FIT), "other actions", false);
            other.setStyle(Font.ITALIC);
            new PdfOutline(other, new PdfAction("remote.pdf", 1), "Go to yhe first page of a remote file");
            new PdfOutline(other, new PdfAction("remote.pdf", "test"), "Go to a local destination in a remote file");
            new PdfOutline(other, PdfAction.javaScript("app.alert('Hello');\r", writer), "Say Hello");
           
            remote.add(new Paragraph("Some remote document"));
            remote.newPage();
            Paragraph p = new Paragraph("This paragraph contains a ");
            p.add(new Chunk("local destination").setLocalDestination("test"));
View Full Code Here

            PdfDestination d3 = new PdfDestination(PdfDestination.FITR, 200, 300, 400, 500);
            PdfDestination d4 = new PdfDestination(PdfDestination.FITBV, 100);
            PdfDestination d5 = new PdfDestination(PdfDestination.FIT);
           
            // we define the outlines
            PdfOutline out1 = new PdfOutline(cb.getRootOutline(), d1, "root");
            PdfOutline out2 = new PdfOutline(out1, d2, "sub 1");
            new PdfOutline(out1, d3, "sub 2");
            new PdfOutline(out2, d4, "sub 2.1");
            new PdfOutline(out2, d5, "sub 2.2");
    } catch (Exception de) {
      de.printStackTrace();
    }

    // step 5: we close the document
View Full Code Here

     */
    public void onParagraph(PdfWriter writer, Document document, float position) {
        n++;
        PdfContentByte cb = writer.getDirectContent();
        PdfDestination destination = new PdfDestination(PdfDestination.FITH, position);
        new PdfOutline(cb.getRootOutline(), destination, "paragraph " + n);
    }
View Full Code Here

            }
        }
        if (target == null) {
            target = _defaultDestination;
        }
        PdfOutline outline = new PdfOutline(parent, target, bookmark.getName());
        writeBookmarks(c, root, outline, bookmark.getChildren());
    }
View Full Code Here

TOP

Related Classes of com.lowagie.text.pdf.PdfOutline

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.