views:

51

answers:

1

Hello to all,

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"); 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

A: 

trying your code, i've got the following result :

goto link: [www.arzneimittelinfoservice.de]

adding the www chunk as such, i got the following result:

goto link :www.arzneimittelinfoservice.de

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.

...   
Phrase link = new Phrase("goto link: ");
link.add(www);

Regards
Guillaume

PATRY
thanks a lot, that did the job..
mahdia