c# - C# 中的 FontFamily 问题

标签 c# asp.net evopdf

我在我的网页的 CSS 中使用 Google 字体“Open Sans,sans-serif”。​​我正在使用 evo pdf 生成 PDF。在此使用 TextElement 动态创建页眉和页脚。

我的问题是在 c# fontfamily 中没有这样的 Google 字体。如何在 c# fontfamily 中获得“Open Sans,sans-serif”?

TextElement footerText = new TextElement(0, 15, "Page &p; of &P;  ",
                new System.Drawing.Font(this.OpenSans,12, FontStyle.Regular, GraphicsUnit.Pixel));
footerText.TextAlign = HorizontalTextAlign.Right;
footerText.ForeColor = Color.Black;
footerText.EmbedSysFont = true;
htmlToPdfConverter.PdfFooterOptions.AddElement(footerText);

最佳答案

TextElement footerText = new TextElement(0, pdfConverter.PdfFooterOptions.FooterHeight - 15, 
            "This is page &p; of &P;  ",
            new System.Drawing.Font(new System.Drawing.FontFamily("Times New Roman"), 

这不是您要找的吗:evo guide to using fonts

关于c# - C# 中的 FontFamily 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28424508/

相关文章:

javascript - 从通过 jQuery AJAX 调用的 Controller 返回 PDF

html - EVO PDF : Side-by-side tables & repeating headers

c# - 如何连接两个平行的2d多边形以创建无缝的3d网格?

c# - 在 PLINQ 中,.AsSequential() 和 .AsOrdered() 有什么区别?

c# - 创建 pdf 错误消息(...文件已损坏且无法修复)

asp.net - 存储过程不创建新表

c# - 使用 HiddenField 将 jQuery 变量传递到 ASP.NET 代码中

c# - Jquery UI - asp.net 上的 Accordion

c# - ASP.NET : the connection is closed