iText 7 java.lang.NoSuchMethodError [英] iText 7 java.lang.NoSuchMethodError

查看:95
本文介绍了iText 7 java.lang.NoSuchMethodError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始开发一个将HTML页面转换为PDF的新功能。我使用iText 7.按照指示此处

I just started developing a new function to convert HTML page to PDF. I use iText 7. Followed the instruction here!.

现在我收到错误线程main中的异常java.lang.NoSuchMethodError:com.itextpdf.layout.font.FontSet.getFonts ()Ljava / util / Set;

我按照指令这里!但仍然收到同样的错误。

I have created pom.xml following the instruction here! but still received the same error.

我使用eclipse。我将pom.xml放在WebContent文件夹中并收到错误。将pom.xml移动到WEB-INF文件夹时的结果相同。

I use eclipse. I put the pom.xml in the WebContent folder and received the error. Same result when moved the pom.xml into the WEB-INF folder.

pom.xml的目录是错误的吗?

Is the directory for the pom.xml wrong?

我已经解决了这个问题此处!并此处!但仍然无效

I've gone through the question here! and also here! but still doesn't work

请咨询。

推荐答案

pdfHTML 1.0.0 与iText Core <$不兼容 7.0.3 ,它仅与iText Core 7.0.2 兼容。有关详细信息,请参阅GitHub上的兼容性矩阵: https://github.com /itext/itext7/releases/tag/7.0.3

pdfHTML 1.0.0 is not compatible with iText Core 7.0.3, it is only compatible with iText Core 7.0.2. Please refer to the compatibility matrix on GitHub for details: https://github.com/itext/itext7/releases/tag/7.0.3

iText Core 7.0.4 和计划于本月晚些时候一起发布的pdfHTML 1.0.1 也将兼容。

iText Core 7.0.4 and pdfHTML 1.0.1, scheduled to be released together later this month, will also be compatible.

如果你愿意的话想要使用快照构建,您可以将其添加到 pom.xml 并使用iText Core 7.0.4-SNAPSHOT 和pdfHTML 1.0.1-SNAPSHOT

Meanwile if you want to use snapshot builds, you can add this to your pom.xml and use iText Core 7.0.4-SNAPSHOT and pdfHTML 1.0.1-SNAPSHOT:

<repositories>
  <repository>
    <id>itext-snapshots</id>
    <name>iText Repository - snapshots</name>
    <url>https://repo.itextsupport.com/snapshots</url>
    <snapshots>
      <enabled>true</enabled>
    </snapshots>
  </repository>
</repositories>

使用风险自负,因为快照构建不受支持且仅限对于愿意通过跟踪最新开发并提交拉取请求来为iText做出贡献的有经验的开发人员。

Use at your own risk, because snapshot builds are unsupported and are only for experienced developers who are willing to contribute to iText by following the latest development and submitting pull requests.

永远不要在生产环境中使用快照

或者等到月末,你可以使用iText Core 7.0.4 和pdfHTML 1.0.1

Or just wait until the end of the month, when you can use iText Core 7.0.4 and pdfHTML 1.0.1.

这篇关于iText 7 java.lang.NoSuchMethodError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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