您正在使用ITextRenderer
,这导致您相信您正在使用飞碟。 飞碟不是iText。 Flying Saucer是使用旧版iText的第三方产品,并未得到iText Group的认可。
旧版本的iText不支持泰卢固语。支持编写Devenagari,Tamil,Telugu等系统......需要pdfCalligraph add-on。此插件仅适用于iText 7.我们已经撰写了关于此主题的综合文章white paper。
如果您想将HTML与泰卢固语转换为PDF格式,您无法使用飞碟实现此功能。据我所知,唯一允许你这样做的工具是iText 7,Telugy支持的pdfCalligraph add-on和pdfHTML add-on将HTML转换为PDF的组合。
更新:
如果你想使用pdfCalligraph,您需要添加以下依赖:
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>typography</artifactId>
<version>[1.0,)</version>
<scope>compile</scope>
</dependency>
由于pdfCalligraph是封闭源代码插件,您还需要添加我们的封闭源代码库到您的存储库列表:
<repositories>
<repository>
<id>central</id>
<name>iText Repository-releases</name>
<url>https://repo.itextsupport.com/releases</url>
</repository>
</repositories>
最后,您需要引入许可证密钥机制(否则pdfCalligraph会抛出com.itextpdf.licensekey.LicenseKeyException
或java.io.FileNotFoundException:itextkey.xml
):
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itext-licensekey</artifactId>
<version>[2.0,)</version>
<scope>compile</scope>
</dependency>
你需要一个许可证密钥(KEY
),你需要加载像这样的关键:
LicenseKey.loadLicenseFile(new FileInputStream(KEY));
KEY
包含的路径XML文件。这个XML文件是您的许可证密钥。你可以在这里获得这样一个XML文件:free trial。
此外,他们使用iText 4.2.0,这是iText Software从未发布的版本,但是由ymasory/InProTopia发布。 –
能否请你解释更多...尝试用itext7生成泰卢固语pdf。我们仍然满足于差距。 – user1896803
@ user1896803如果你得到的内容有差距,你不使用pdfCalligraph。请注意pdfCalligraph是* closed source *。如果你想使用它,它需要一个试用许可证。你有试用许可证吗?在本教程的第2章中搜索单词“pdfCalligraph”:http://developers.itextpdf.com/content/itext-7-building-blocks/chapter-2-working-rootelement –