Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8131737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:10:20+00:00 2026-06-06T09:10:20+00:00

iTextSharp doesn’t display Japanese font. I found a solution but when I compile, I

  • 0

iTextSharp doesn’t display Japanese font. I found a solution but when I compile, I get an error saying:

Font ‘STSong-Light’ with ‘UniGB-UCS2-H’ is not recognized.

Here’s my source code:

BaseFont.AddToResourceSearch(serverPath + "\\lib\\iTextAsian.dll");
BaseFont.AddToResourceSearch(serverPath + "\\lib\\iTextAsianCmaps.dll");
BaseFont font = BaseFont.CreateFont("STSong-Light", "UniGB-UCS2-H", BaseFont.EMBEDDED);    

using (Document document = new Document())
{
    using (PdfSmartCopy copy = new PdfSmartCopy(
        document, new FileStream(directoryOutPdf + nameOutPdf, FileMode.Create))
    )
    {
        document.Open();

        // generate one page per statement        
        for (int i = 0; i < countBlank.Count; i++)
        {                        
            // replace this with your PDF form template          
            PdfReader reader = new PdfReader(pdfTemplatePath + @"\EmptyTemplateBankBlank_2012.pdf");
            using (var ms = new MemoryStream())
            {
                using (PdfStamper stamper = new PdfStamper(reader, ms))
                {
                    AcroFields form = stamper.AcroFields;
                    form.SetFieldProperty("Info", "textfont", font, null);
                    form.SetField("Info", "_源泉徴収票");                                                                
                    stamper.FormFlattening = true;
                }
                reader = new PdfReader(ms.ToArray());

                copy.AddPage(copy.GetImportedPage(reader, 1));
            }
        }
    }
}

I think it’s because I didn’t install the STSong-Light font. Unfortunately I could not find STSong-Light and, therefore, had to set Stsong font, but it still does not work.

String fontPath = Path.Combine(serverPath + "\\Fonts", "STSONG.ttf");

BaseFont baseFont = BaseFont.CreateFont(fontPath, "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);
Font font = new Font(baseFont, 12, Font.NORMAL);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T09:10:21+00:00Added an answer on June 6, 2026 at 9:10 am

    Set the SubstitutionFont after creating the PdfStamper:

    stamper.AcroFields.AddSubstitutionFont(myFont.BaseFont);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using iTextSharp to convert HTML to PDF and it doesn't seem to
I'm currently using ITextSharp to write a PDF to a web browser, but I
I'm using itextsharp to generate the PDFs, but I need to change some text
i am using itextsharp and i am trying to get all the fonts of
I'm trying to save to databse a pdf file generated by itextsharp. But, I
I need to display a text like this on my PDF using iTextSharp Recommendation
I am trying to use PdfSmartCopy from ItextSharp but I cannot find any relevant
I use iTextSharp to sign a PDF file. But Adobe Reader cannot verify my
I'm using the latest version of iTextSharp found here: http://sourceforge.net/projects/itextsharp/ I am trying to
I am trying to do something relatively simple with iTextSharp, but I always find

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.