您正在使用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 –