如何设置 pdfptable 的字体?

请您参考如下方法:

创建短语时必须在每个单元格中设置字体:

Dim yourFont As BaseFont = BaseFont.CreateFont( _ 
  Current.Server.MapPath("~/fonts/somefont.TTF"), _ 
  BaseFont.WINANSI, BaseFont.EMBEDDED) 
Dim mainFont As New Font(yourFont, SOME_FONT_SIZE, Font.NORMAL) 
 
Dim cell As New PdfPCell(New Phrase("some text", mainFont)) 
yourTable.Add(cell) 


评论关闭
IT序号网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!