.Net core deployed application not supporting Chinese font in PDF.

Deepak Ramesh (SX/EDA2) 0 Reputation points
2024-04-29T06:30:59.03+00:00

I have chines font in my code when the app is deployed in app service and there is a logic to download the PDF file with the Chinese font, but the font is not visible.

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,231 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,303 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,001 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. JasonPan - MSFT 4,386 Reputation points Microsoft Vendor
    2024-04-29T09:04:45.8666667+00:00

    Hi @Deepak Ramesh (SX/EDA2),

    Please follow my steps to try it.

    1. Add a fonts folder in your project and paste the .woff files.
    2. Make sure it exist in your publish files.
    3. Add below code in your web.config file, you can edit it in App Service Editor.
         <system.webServer>
         <staticContent>
           <remove fileExtension=".woff" />
           <mimeMap fileExtension=".woff" mimeType="application/font-woff" />
         
           <remove fileExtension=".woff2" />
           <mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />
         </staticContent>
         </system.webServer>
         
      

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards,

    Jason

    0 comments No comments