PDFsharp add private/installed font

后端 未结 1 1111
无人及你
无人及你 2021-01-14 15:12

I want to apply Trade gothic font to my pdf text using PDFsharp, I have installed the font and use below line of code to apply

XPdfFontOptions options = new         


        
相关标签:
1条回答
  • 2021-01-14 15:44

    When using fonts with PDFsharp, make sure the font is a TrueType font (not a PostScript font).

    Also make sure you write the font name correctly - as shown by the Font applet of Windows or as shown by Word.

    You can use a private font collection to use fonts that are not installed on the computer. This should solve your "problem" with Windows Server 2008. Use the WPF build of PDFsharp.

    The PDFsharp source package includes a full working sample that uses private fonts.
    A code snippet can be seen here:
    http://pdfsharp.net/wiki/PrivateFonts-sample.ashx

    0 讨论(0)
提交回复
热议问题