I am trying to add anchor(named destinations) to pdf using itext java api. But it\'s not working.When I click the text , nothing happens.This is what I am doing .
Try this. It worked for me. setLocalGoto()
and setLocalDestination()
will do the magic.
Chunk chunk = new Chunk("Contact information");
chunk.setLocalGoto("contact");
document.add(new Paragraph(chunk));
document.newPage();
chunk chunk1 = new Chunk("Contact information");
chunk1.setLocalDestination("contact");
Chapter chapter = new Chapter(new Paragraph(chunk1),1);
chapter.setNumberDepth(0);
document.add(chapter);