// 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"));