Thai characters not visible on the rendered report

Stimulsoft Reports.JS discussion
Post Reply
rpotyka
Posts: 13
Joined: Mon Jan 07, 2019 8:26 am

Thai characters not visible on the rendered report

Post by rpotyka »

When generating pdf report some special characters like thai alphabet letters are not displayed(but they are on the generated pdf cn be selected and copied with original value)
The issue looks like an issue with the fonts not being properly embedded in the pdf. I've tried adding in arial font which did not work and also I've tried to set pdf export service settings embeddedFonts, useUnicode and standardPdfFonts to true, none of which had any effect on the results.
Exporting report from the viewer gives the same results.
What is even more peculiar is the fact that the characters are displayed properly when viewing pdf in microsoft edge or mozilla firefox, but are not displayed in google chrome, opera or acrobat reader.

On the second know I've noticed that in most of your examples you're adding Roboto-Back.ttf font file to stiFontCollection and I'm not quite why is that necesarry? I've noticed that without it being included all characters are messy and incorrectly displayed. Is it some sort of Stimulsofts internal system font?

I've attached an example with sample pdf already exported.

Would much appreciate if you could investigate the issue as soon as possible as this is an urgent issue to be resolved in my project
Attachments
thaiCharactersExample.zip
(132.59 KiB) Downloaded 165 times
Lech Kulikowski
Posts: 6239
Joined: Tue Mar 20, 2018 5:34 am

Re: Thai characters not visible on the rendered report

Post by Lech Kulikowski »

Hello,

You should add your fonts in the collection as in samples.

Thank you.
rpotyka
Posts: 13
Joined: Mon Jan 07, 2019 8:26 am

Re: Thai characters not visible on the rendered report

Post by rpotyka »

That's precisely what I'm doing in the example I've sent you but without any success.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Thai characters not visible on the rendered report

Post by HighAley »

Hello,

Are you sure that all used symbols are included to the attached font?
Please, read next article https://stimulsoft.zendesk.com/hc/en-us ... PDF-export

Thank you.
rpotyka
Posts: 13
Joined: Mon Jan 07, 2019 8:26 am

Re: Thai characters not visible on the rendered report

Post by rpotyka »

HI, I've checked the loaded font and it had mising thai characters, so I've tried loading another one which didn't take any effect.
I think the problem might stem from default font being applied on the designer part. Then application opening the pdf uses system font as well which results in some characters being missed.
Is there a way to apply/enforce font on the deigner side to stop it from setting system font?
Lech Kulikowski
Posts: 6239
Joined: Tue Mar 20, 2018 5:34 am

Re: Thai characters not visible on the rendered report

Post by Lech Kulikowski »

Hello,

We need some additional time to investigate the issue.

Thank you.
rpotyka
Posts: 13
Joined: Mon Jan 07, 2019 8:26 am

Re: Thai characters not visible on the rendered report

Post by rpotyka »

Hi, do you know if there's any way to upload font file as a resource in designer from code and change the font used on report from code?
Lech Kulikowski
Posts: 6239
Joined: Tue Mar 20, 2018 5:34 am

Re: Thai characters not visible on the rendered report

Post by Lech Kulikowski »

Hello,

You can use the following code to add resource:

Code: Select all

var resource = new Stimulsoft.Report.Dictionary.StiResource("Name", "Alias", false, Stimulsoft.Report.Dictionary.StiResourceType, content);
report.dictionary.resources.add(resource);
Thank you.
rpotyka
Posts: 13
Joined: Mon Jan 07, 2019 8:26 am

Re: Thai characters not visible on the rendered report

Post by rpotyka »

Hi,

thanks a lot for the info will check if it will be suitable for my solution now (I suppose that file can be used in that function as well). In the meantime I'd have a question if you know if there's any possibility to replace fonts on texts or just text variables in the report before rendering it? I found a solution but it was .Net specific and I'm not sure whether it is possible at all in the javascript solution.

Kind regards.
Lech Kulikowski
Posts: 6239
Joined: Tue Mar 20, 2018 5:34 am

Re: Thai characters not visible on the rendered report

Post by Lech Kulikowski »

Hello,

We need some additional time to check the issue. We will let you know about the result.

Thank you.
Post Reply