C#ItextSharp Fontawesome图标(货币) - PDF

时间:2015-05-25 14:50:55

标签: c# pdf icons itextsharp

我有问题是导入图标(fontawesome-webfont.ttf)并在PDF上显示它们 - 但我无法在PDF上显示它们特别是货币图标(fa-money)我能够获得的一些图标它来自CultureInfo类,如果有任何我错过了这个

chunkRows = new Chunk(val.ToString("C", new CultureInfo(strCulture)) + "  ", rowFont);

我如何解决这个问题需要帮助

代码---

var fontAwesomeIcon = BaseFont.CreateFont(fontpath + "fontawesome-webfont.ttf", BaseFont.CP1252, BaseFont.EMBEDDED);

Font fontAwe = new Font(fontAwesomeIcon,8,Font.NORMAL,Color.BLACK);

chunkRows = new Chunk("\f0d6", fontAwe);

1 个答案:

答案 0 :(得分:1)

请调整您的代码:

var fontAwesomeIcon = BaseFont.CreateFont(fontpath + "fontawesome-webfont.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
Font fontAwe = new Font(fontAwesomeIcon, 8);
chunkRows = new Chunk("\uf0d6", fontAwe);

结果如下:

enter image description here