Itext 7使用pdf中的材料ui图标

问题描述 投票:1回答:1

在创建PDF文档时,如何使用材料ui图标作为字体。我想用MaterialIcons-Regular.ttf作为字体。

有没有我可以参考的例子。或者是否有更好的方法使用itext7处理PDF文档中的字体图标。

java itext itext7 google-material-icons
1个回答
1
投票

我不完全确定你在问什么,但它应该是这样的:

PdfFont f1 = PdfFontFactory.createFont("MaterialIcons-Regular.ttf", "Identity-H", true);
Paragraph p1 = new Paragraph("Testing of symbols \ue000,\ue0bb").setFont(f1);

请注意,字符位于私有区域中。在Windows中安装字体并使用字符映射应用程序来定位字符。

© www.soinside.com 2019 - 2024. All rights reserved.