java - itext pdf generation fail on parsing some html tags -


i have html code, reside in db , want parse in pdf. using itext pdf generation. here html in db:

<p>no note.</p><br> <ul><br> <li><strong>section</strong></li><br> </ul><br> <ol><br> <li>first</li><br> <li><em>second</em></li><br> <li><span style="text-decoration: underline;">third</span></li><br> </ol><br> 

and here parsed , inserted pdf:

<p>no note.</p><br> <strong>section</strong><br> first<br> <em>second</em><br> <span style="text-decoration: underline;">third</span><br> 

and here code parse html pdf:

org.jsoup.nodes.document doc = jsoup.parse(text); list<element> objects; objects = htmlworker.parsetolist(new stringreader(doc.outerhtml()), null); (element object : objects) {         element ele = (element) object;         document.add(ele); } 

as can seen numbers , bullet not shown (which "ol" , "li" tags in html). how solve this?

edit

for more clarification. here text have in html:

enter image description here

and here note inserted pdf:

enter image description here

my friend solved it:

xmlworkerhelper.getinstance().parsexhtml(new xhtmlelementhandler(document), new stringreader(text));

simple :)


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -