不使用iText XML解析器解析HTML字符串 [英] HTML String is not parsed with iText XML parser

查看:201
本文介绍了不使用iText XML解析器解析HTML字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法使用iText的xmlworker-5.5.9.jar解析HTML字符串

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

低于助手类:

XMLWorkerHelper.parseToElementList(FOOTER, CSS);

我收到以下错误:

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

我看到了iText的documentatin和在这个论坛中回答

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

任何帮助将不胜感激。谢谢。

Any help will be appreciated. Thanks.

推荐答案

上述异常是由于xmlWorker.jar和itextpdf.jar不兼容造成的。因此,为避免上述异常,请在项目中使用单个itextpdf.jar,并在itextpdf-5.5.1.jar版本之上。

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.

这篇关于不使用iText XML解析器解析HTML字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆