我在pdf文档中需要在单元格中加入一些特殊的字符,我试着搜索相关结果,但没有找到任何字符。 另外还有正方形、立方体等符号。
以下是我的代码片段
public Font calibri_7 = FontFactory.GetFont("Calibri", 7, Font.NORMAL);
PdfPCell cb21 = new PdfPCell(new Phrase("50+/-25", calibri_7));
我需要做什么改变,为了得到它,谢谢!我的工作在pdf文档中,我必须在单元格短语中包含一些特殊的字符,我试图搜索相关的结果,但没有找到任何 该字符是+-符号。
要把这个字符放在你的pdf中,你应该使用unicode字符转义。\u2213. 如果你想知道其他特殊字符的unicode符号,那么我想推荐下一个资源。https:/charbase.comblockmathematical-operators。
然后,你的代码应该修改为以下内容。
PdfPCell cb21 = new PdfPCell(new Phrase("\u00B1", calibri_7));