Friday, December 30, 2011

Anchor link page-citation in iText

We can give the link and page citation for or PDF file using itext....

For instead of generating pdf via xml and xslt, We can get from itext,

here also we can give link and page citation use of following classes.,

Font font = new Font();
docpdf.add(new Chunk("Chapter 1"));
docpdf.add(new Paragraph(new Chunk("Press here to go chapter 2", font).setLocalGoto("2")));// Code 2
docpdf.add(new Chunk("Chapter 2").setLocalDestination("2"));
docpdf.add(new Paragraph(new Chunk("", font).setAnchor("")));//Code 3
docpdf.add(new Paragraph( new Chunk("Open CreatePDFInlotus.pdf chapter 3", font).setRemoteGoto("D:\\Ram\\CreatePDFInlotus.pdf", "3")));//Code 4

No comments:

Post a Comment