i try to embed a link to an external website into a pdf-file, generated with iText.
Heres the code:
Phrase modul = new Phrase (“some text”);
Chunk www = new Chunk (“www.arzneimittelinfoservice.de”);
http://www.setAction(new PdfAction(new URL(“http://www.arzneimittelinfoservice.de“)));
Phrase xref = new Phrase(www);
Phrase link = new Phrase(“goto link: ” + xref);
…
Problem: in the resulting pdf-doc the link referres to http://www.arzneimittelinfoservice.de], I can’t get rid of the closing square bracket.
Perhaps someone can help me with this.
Thanks, Frank
trying your code, i’ve got the following result :
adding the www chunk as such, i got the following result:
you do this by adding the chunck to the phrase, and not by converting it to string, which is what the “+” is doing in the “goto link: ” + xref part.
Regards
Guillaume