生成PDF时,不显示⊕符号,而是显示替换符号。有可能以某种方式解决这个问题吗?
测试的版本:
测试字体:
码
string fileName = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString() + ".pdf");
var doc = new Document();
doc.Styles["Normal"].Font.Name = "Consolas";
doc.AddSection().AddParagraph("A ⊕ B");
var pdfRenderer = new PdfDocumentRenderer(true);
pdfRenderer.Document = doc;
pdfRenderer.RenderDocument();
pdfRenderer.PdfDocument.Save(fileName);
Process.Start(fileName);
发布于 2017-02-08 10:41:34
使用包含“圈加”字符的字体。
你可以用。"Segoe UI符号“。"Segoe“不包含该字符。
当使用这些符号时,MS会自动切换字体,使用MigraDoc时,您必须根据需要切换字体。
如果你想在其余的文本中使用"Consolas“,使用AddFormattedText
作为圆圈加号,然后切换到。此符号的"Segoe UI符号“。
发布于 2017-02-08 10:06:53
试着取代
doc.AddSection().AddParagraph("A ⊕ B");
通过以下方式:
doc.AddSection().AddParagraph("A \u2295 B");
https://stackoverflow.com/questions/42109098
复制相似问题