List of usage examples for com.lowagie.text.pdf PdfContentByte localDestination
public boolean localDestination(String name, PdfDestination destination)
From source file:questions.stamppages.ParagraphBookmarkEvents.java
/** * Adds an outline for every new Paragraph * //from ww w. ja va 2 s . c o m * @param writer * @param document * @param position */ public void onParagraph(PdfWriter writer, Document document, float position) { n++; PdfContentByte cb = writer.getDirectContent(); PdfOutline root = cb.getRootOutline(); PdfDestination destination = new PdfDestination(PdfDestination.FITH, position); if (named) { cb.localDestination("p" + n, destination); new PdfOutline(root, PdfAction.gotoLocalPage("p" + n, false), "paragraph " + n); } else { new PdfOutline(root, destination, "paragraph " + n); } }