Issue in displaying Japanese Characters

Posted by: Swapnil.Walwadkar on 25 November 2021, 6:36 am EST

  • Posted 25 November 2021, 6:36 am EST

    Hi,

    I am creating a PDF file using C1PdfDocument in which I am inserting a few Japanese characters.

    If I open this PDF file in Adobe Acrobat Reader, the Japanese characters are not visible. Could you please let me know how to display Japanese characters in a PDF file?

    I have attached a sample PDF file in which the issue is being observed. Also sharing the PDF creation code for reference.

    C1.C1Pdf.C1PdfDocument pdf = new C1.C1Pdf.C1PdfDocument();

    System.Drawing.Font font = new System.Drawing.Font(“MS Gothic”, 9, System.Drawing.FontStyle.Regular);

    pdf.PaperKind = System.Drawing.Printing.PaperKind.A4;

    RectangleF rect = pdf.PageRectangle;

    rect.Inflate(-48, -48);

    pdf.Security.AllowCopyContent = false;

    pdf.Security.AllowEditContent = false;

    pdf.Security.AllowEditAnnotations = false;

    while (true)

    {

    int nextChar = pdf.DrawString(data, font, Brushes.Black, rect);

    if (nextChar >= data.Length)

    {

    break;

    }

    data = data.Substring(nextChar);

    pdf.NewPage();

    }

    pdf.Save(path);

  • Posted 26 November 2021, 6:50 am EST

    Hi Swapnil,

    Thanks for providing code snippet. And it seems like you have forget to attach Pdf file.

    However, we have checked some Japanese characters, and they inserted successfully into the pdf while creating.

    Could you please provide the Japanese character or small sample replicating this behavior.

    You can also refer the attached sample for the same : PdfJapaneseCharacterExample.zip

    Regards,

    Nitin

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels