我在 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);