I am using HiQPdf to generate a table of content and adding some text and links. Recently I had some use cases where the text is in Chinese or in Korean characters.These texts are not displayed correctly on the Pdf, even if they are displayed correctly as bookmarks (Outlines). this is how i'm doing this:
System.Drawing.Font sysFont = new System.Drawing.Font( "Times New Roman", 10, System.Drawing.GraphicsUnit.Point );
PdfFont pdfFontEmbed = _document.CreateFont( sysFont, true );
PdfText textEntry = new PdfText( 10, 10, 600, "사용자 정의", pdfFontEmbed );
_document.Pages[0].Layout( textEntry );
And as a result I only have rectangles.
Any help will be much apreciated!!
Try using "Arial Unicode MS" instead of "Times New Roman". Have not test it yet as I am not using HiQPdf. If this doesn't help, try Free Spire.PDF Nuget Package and below code:
PdfDocument pdf = new PdfDocument();
PdfPageBase page = pdf.Pages.Add();
PdfTrueTypeFont font = new PdfTrueTypeFont(new Font("Arial Unicode MS", 11f), true);
page.Canvas.DrawString("사용자 정의", font, PdfBrushes.Red, 50, 50);
pdf.SaveToFile("result.pdf");