C# 使用PDFsharp格式化文本

C# 使用PDFsharp格式化文本,c#,pdfsharp,C#,Pdfsharp,我想把风格运用到 字符串“Helloword” 并具有样式属性 像fontFamily='Verdana',fontStyle='bold',FontSize='12',textDecoration='underline',textAlign='center',fontColor='#FF0000',x=100和y=100 我想使用PDFsharp以PDF格式显示此字符串。有人能建议我怎么做吗 我正在使用XFont和XGraphics.DrawString方法,但我无法应用上述所有样式。字符串有

我想把风格运用到

字符串“Helloword”

并具有样式属性

像fontFamily='Verdana',fontStyle='bold',FontSize='12',textDecoration='underline',textAlign='center',fontColor='#FF0000',x=100和y=100

我想使用PDFsharp以PDF格式显示此字符串。有人能建议我怎么做吗


我正在使用
XFont
XGraphics.DrawString
方法,但我无法应用上述所有样式。

字符串有点不正确,但我希望满足所有其他要求:

// Create a font
XFont font = new XFont("Verdana", 12, XFontStyle.Bold | XFontStyle.Underline);

// Draw the text
gfx.DrawString("Hello, World!", font, new XSolidBrush(XColor.FromArgb(255, 0, 0)),
  100, 100,
  XStringFormats.Center);

可能这个链接会帮助你我想应用上面提到的所有样式属性。。