Convert HTML to PDF using Blink in Asp.NET Core not render asian characters

Hi,

I've done a web application in ASP.NET (NET 5) that convert an HTML page (by url) to a PDF using Blink's Engine.

I've deployed it on Azure in a docker container and it works well.


The problem comes when I try to convert a page with asian languages like japanese or chinese.

All characters are not rendered.


Can you help me?


version: 19.1.0.54


The output is:

sample.jpg


Docker file: ( PRJNAME is a placeholder for my project name )

#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.


FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base

RUN apt-get update && \

     apt-get install -yq --no-install-recommends \

     libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 \

     libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 \

     libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 \

     libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \

     libnss3


WORKDIR /app

EXPOSE 80

EXPOSE 443


FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build

WORKDIR /src

COPY ["PRJNAME/PRJNAME.csproj", "PRJNAME/"]

RUN dotnet restore "PRJNAME/PRJNAME.csproj"

COPY . .

WORKDIR "/src/PRJNAME"

RUN dotnet build "PRJNAME.csproj" -c Release -o /app/build


FROM build AS publish

RUN dotnet publish "PRJNAME.csproj" -c Release -o /app/publish


FROM base AS final

WORKDIR /app

COPY --from=publish /app/publish .

ENTRYPOINT ["dotnet", "PRJNAME.dll"]


1 Reply 1 reply marked as answer

GK Gowthamraj Kumar Syncfusion Team October 21, 2021 09:29 AM UTC

Hi Focus,

Thank you for contacting Syncfusion support.

The reported rendering issue may occurs due to the required fonts are not available in Linux docker environment. To overcome this, you have to include the required fonts to render the characters in docker file. Please try the below steps to add custom fonts in Linux docker (please change the rendering engine to Blink) and let us know the result. 

If still you are facing an issue, we request you to share the complete URL/Html ( with all resource such as image, fonts, script, styles, etc), output document, Syncfusion product version, code snippet or simple sample to reproduce the issue on our end. So, that it will be helpful for us to analyze and assist you further on this.   
  
Regards, 
Gowthamraj K 


Marked as answer
Loader.
Up arrow icon