I have problem with displaying Chinese characters in PDFSharp in C#. During process of creating the PDF string it's ok, but after creating pdf file it doesn't display it. I found one solution which is
XFont font_small2 = new XFont("微软雅黑", 9, XFontStyle.Regular, options)
This solutions works on my localhost but when I release this on beta server it doesn't display Chinese characters.
You can embed original Chinese font into your pdf file and use correct CMAP.
var options = new XPdfFontOptions(PdfFontEmbedding.Always);
var font = new XFont("微软雅黑", 9, XFontStyle.Regular, options);
OR
var page = new PdfPage();
var gfx = XGraphics.FromPdfPage(page);
gfx.MFEH = PdfFontEmbedding.Automatic;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With