簡體   English   中英

使用iText 7的PDF中的希臘字符

[英]Greek characters in PDF with iText 7

我正在嘗試使用iText 7 for Java創建帶有希臘字符的pdf。 在PDF中僅可見拉丁字符和數字。

我正在使用以下代碼加載字體:

PdfFont normalFont = PdfFontFactory.createFont(FontConstants.HELVETICA, "CP1253");

我該怎么辦?

這是解決方案:

PdfFont normalFont = PdfFontFactory.createFont("C:\\Windows\\Fonts\\arial.ttf", "Identity-H", true);

您可以使用任何支持您的語言的字體。 另外,Identity-H作為PDF文件的編碼似乎也很重要。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM