本文介绍了MigraDox C#复选框 - Wingdings不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要模拟使用MigraDoc库生成的PDF中的复选框。我偶然发现了两个提供基本相同解决方案的资源()

I am needing to simulate a checkbox in a PDF I am generating using the MigraDoc library. I stumbled across two sources that offer essentially the same solution (here and here)

但是,我没有得到预期的结果。相反,我正在为应该检查的盒子取þ,¨对于那些没有检查的盒子。问题是什么?

However, I am not getting the expected results. Instead I am getting þ for boxes that are supposed to be checked, and ¨ for those that are to be unchecked. What might the issue be?

我的代码片段

     para = section.AddParagraph();
        para.Style = "ListLevelOne";
         para.AddFormattedText("1 ", "Bold");
         para.AddFormattedText(IsQ1Checked ? "\u00fe" : "\u00A8", new Font("Wingdings"));


推荐答案

MigraDoc不使用字体Wingdings,而是它使用一个默认的字体(可能是MS Sans左右),因此你看到的是标准字体的字符,而不是Wingdings的符号。

MigraDoc does not use the font "Wingdings", instead it uses a default font (could be MS Sans or so) and therefore you see the characters from a standard font, not the Wingdings symbol.

问题出在你在这里显示的代码片段。确保Wingdings字体安装在电脑上。

The problem is somewhere outside the code snippet you are showing here. Make sure the font Wingdings is installed on the computer.

这篇关于MigraDox C#复选框 - Wingdings不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 09:45