[HtmlToPdfConverter on linux] Nodes with non-english annotations does not print/export correctly.

Hello Syncfusion team,

I'm using @syncfusion/ej2-angular-diagrams (version 19.3.55) and Syncfusion.HtmlToPdfConverter.QtWebKit.Net.Core (version 19.4.0.38) in my app.

I have SVG nodes in my app, and consequently, to print these, I have to call DiagramComponent::getDiagramContent() and send it server-side (linux) and export it with HtmlToPdfConverter.

I noticed that non-english annotations do not print properly. See example below:

Original diagram


Exported image


I also noticed that using UTF8 as the encoding for WebKitConverterSettings will fix this issue on Windows, but not on linux.



I've attached all necessary files (diagram json, html output from getDiagramContent method etc).

Please let me know if any additional information is needed for troubleshooting.

Thanks,

-Mithun


Attachment: nonenglishannotationissue_203c05ce.zip


6 Replies

MI Mithun January 5, 2022 05:29 AM UTC

Also here are the contents of my QtBinariesLinux folder and the apt-get packages installed via my dockerfile.


QtBinariesLinux folder



apt-get packages installed via dockerfile






SG Shyam G Syncfusion Team January 5, 2022 02:21 PM UTC

Hi Mithun,


We will validate your requirement and update you with more details on 7th January, 2022.


Regards,

Shyam G



SG Shyam G Syncfusion Team January 7, 2022 01:42 PM UTC

Hi Mithun,


Currently we are analysing this issue in the linux docker and will update you with more details on 11th January, 2022.


Regards,

Shyam G



SG Sivaram Gunabalan Syncfusion Team January 11, 2022 04:22 PM UTC

  
Hi Mithun, 
 
The reported font issue may occur due to the missing of required mentioned or supported font in the Linux environment. The default font for windows and Linux will be different, so the reported issue may occur. So, kindly try the conversion in Linux after adding the required fonts (example font location in Linux machine, /usr/share/fonts/truetype/). We attached the simple modified sample with required fonts for Linux below for your reference. 
 
 
Note: We attached the QtBinariesLinux folder to the below link. Kindly copy and paste the QtBinariesLinux folder into the visual studio project location. 
 
 
Kindly refer below KB for more information about using external fonts, 
  
Kindly try the above provided sample on your end and let us know the result. 
  
Regards, 
Sivaram G 




MI Mithun January 12, 2022 07:31 AM UTC

Hi Sivaram,

Thanks for the detailed reply.

After digging a bit into this, I realized that Roboto Mono font used in my app does not actually handle most unicode characters. See pic below.



In the sample, you provided, the roboto mono ttf files are actually redundant (i.e. they don't get used while printing/rendering).

Only the arialunicodems.ttf file gets used (possibly as a fall-back font).

You can try it out for yourself (remove all roboto mono ttf files, keep only the arialunicodems.ttf file in your sample).


While arialunicodems.ttf seems to handle most unicode characters, some languages are still not supported (e.g. sinhala).

Will revert back with some more details.


Thanks,

-Mithun




SG Sivaram Gunabalan Syncfusion Team January 13, 2022 12:52 PM UTC

Hi Mithun, 

As we said earlier, the reported issue may occur due to the required font is not available in the machine where the conversion takes place. The converter will automatically fallbacks to the system's available font. So the text may be rendered differently based on the fallback font. In this provided sample, arialunicodems.ttf support to handle most of unicode characters, so we included the fonts to rendered the characters correctly. Kindly please add/install the required supported font files to your Linux machine like we shared earlier and try the conversion on your end and let us know the result. 

Regards, 
Sivaram G 


Loader.
Up arrow icon