PDFsharp 自定义字体

PDFsharp & MigraDoc 项目地址:http://www.pdfsharp.net

下载地址:

  • PDFsharp Downloads at sourceforge.net
  • PDFsharp project at sourceforge.net
  • PDFsharp Downloads at codeplex.com
  • PDFsharp project at codeplex.com


PDFsharp 1.3.2

自定义字体:

  System.Drawing.Text.PrivateFontCollection pfc = new System.Drawing.Text.PrivateFontCollection();
        string strFontPath = HttpContext.Current.Server.MapPath("123.ttf");
        pfc.AddFontFile(strFontPath);
     
        XPdfFontOptions options = new XPdfFontOptions(PdfFontEncoding.Unicode, PdfFontEmbedding.Always);
        XFont font1 = new XFont(pfc.Families[0], 15, XFontStyle.Regular, options);



你可能感兴趣的:(String)