html - Acrobat PDF generated with FlyingSaucer & ITextRenderer seems to be removing links -


i have html contains links such following:

<p class="results">web :  split<a href="http://www.google.fr/">http://www</a> split<a href="http://www.google.fr/">.google</a> split<a href="http://www.google.fr/">.fr/</a> </p> 

we converting html pdf using flying-saucer.

i open pdf results following , links not clickable. seems if hrefs not added.

if remove split word, links clickable because built-in reader link detector makes them clickable if valid url.

any ideas why links being removed in final pdf?

code:

  itextrenderer itextrender = null;   tidy tidy = new tidy();   tidy.setxmlout(true);   tidy.setshowwarnings(false);   // tidy.setxmltags(false);   tidy.setinputencoding(utf_8_dn);   tidy.setoutputencoding(utf_8_dn);   tidy.setxhtml(true);//   tidy.setmakeclean(true);    datastream = new bytearrayinputstream(data);    stream = new bytearrayoutputstream(32 * 1024);    post process - convert html xhtml valid format   org.w3c.dom.document w3cdoc = tidy.parsedom(datastream, stream);    itextrender = new itextrenderer();   itextrender.setdocument(w3cdoc, null);    itextrender.layout();   itextrender.createpdf(stream); 

update

i did various experiments , failed. tried adding style display:block links - failed. tried adding form get action , button/submit - failed more input type="button" or submit interpreted textfields in final pdf.

return "<input type=\"button\" value=\"click me\">" +             "<form action=\"http://www.example.com\" method=\"get\">\n" +             "  <input type=\"submit\" /> \n" +             "</form>"+             "</input><a href=\"" + url + "\" title=\"" + linkcontent + "\" target=\"_blank\" style=\"display:block\">" + linkcontent + "</a>"; 

for example, click me button turned editable textfield:

enter image description here enter image description here


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -