HTML String is not parsed with iText XML parser

人盡茶涼 提交于 2019-12-13 10:32:56

问题


I am unable to parse below HTML string using iText's xmlworker-5.5.9.jar

String FOOTER = "<table width=\"100%\" border=\"0\"><tr><td><span class=\"bold\">Footer</span></td><td align=\"right\">Some title</td></tr></table>";

by below helper class:

XMLWorkerHelper.parseToElementList(FOOTER, CSS);

I am getting below error:

Exception in thread "main" java.lang.NoSuchMethodError: com.itextpdf.tool.xml.html.pdfelement.NoNewLineParagraph.setMultipliedLeading(F)V

I saw iText's documentatin and answer in this forum too.

Any help will be appreciated. Thanks.


回答1:


The above exception is beacause of uncompatibility of xmlWorker.jar and itextpdf.jar. So, to avoid above exception use single itextpdf.jar in your project and that is above itextpdf-5.5.1.jar version.



来源:https://stackoverflow.com/questions/37767027/html-string-is-not-parsed-with-itext-xml-parser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!