Thursday 15 March 2012

java - Create HyperLink in dynamic pdf using iText in android -


I have made a pdf dynamic, now I want to add a link to PDF. Is this possible?

If so, and if you have any ideas, please tell me thank you.

Try adding an anchor to this article, under the article link below,

Import and sample code from the article above the link

  import com.itextpdf.text. *; Import com.itextpdf.text.pdf.PdfWriter; Import java.io.phileNotFoundException; Import java.io.FileOutputStream; Public square anchor example {public static zero main (string [] args) {document document = new document (); Try {PdfWriter.getInstance (Document, New FileOutputStream ("Anchor.pdf")); Document.open (); Paragraph paragraph = new paragraph (); Paragraph ADD (new phrase ("You can find the intake tequila on")); Anchor anchor = new anchor ("http://tutorials.jenkov.com/java-text/index.html"); Anchor.setReference ("http://tutorials.jenkov.com/java-text/index.html"); Paragraph.add (anchor); Document.add (paragraph); Document.close (); } Hold (DocumentException e) {e.printStackTrace (); } Hold (FileNotFoundException e) {e.printStackTrace (); }}}    

No comments:

Post a Comment