I just started developing a new function to convert HTML page to PDF. I use iText 7. Followed the instruction here!.
And now i get the error Exception in thread "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.
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.
Is the directory for the pom.xml wrong?
I've gone through the question here! and also here! but still doesn't work
Please advice.
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
and pdfHTML 1.0.1
, scheduled to be released together later this month, will also be compatible.
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>
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.
NEVER USE SNAPSHOT BUILDS IN A PRODUCTION ENVIRONMENT
Or just wait until the end of the month, when you can use iText Core 7.0.4
and pdfHTML 1.0.1
.