Hi all.
I have a little problem when exporting my report to pdf and using embedded fonts options.
When exporting without it, the result is:
Instead when exporting with embedded fonts:
The font I've installed is a google font Montserrat:
https://fonts.google.com/specimen/Montserrat
...adding .mrt in attach, too.
[...]
Suspicious is, the fonts are compressed when embedded.
Are there some other options I can set to solve a problem?
Thanks in advance
Export pdf with embedded fonts
-
- Posts: 10
- Joined: Thu Jan 19, 2023 10:01 am
Export pdf with embedded fonts
- Attachments
-
- Report.mrt
- (29.32 KiB) Downloaded 81 times
-
- Posts: 786
- Joined: Tue Sep 07, 2021 10:11 am
Re: Export pdf with embedded fonts
Hello,
Please clarify, are you exporting the report from the code or from the designer?
Also you can try to add font to report resources.
Thank you.
Please clarify, are you exporting the report from the code or from the designer?
Also you can try to add font to report resources.
Thank you.
-
- Posts: 10
- Joined: Thu Jan 19, 2023 10:01 am
Re: Export pdf with embedded fonts
Hi Max, thanks for your replay.
I export from code. But exporting from the designer, i have the same problem.
So, how can i add the specific .ttf file (or font), inside report resources ?
I export from code. But exporting from the designer, i have the same problem.
So, how can i add the specific .ttf file (or font), inside report resources ?
-
- Posts: 786
- Joined: Tue Sep 07, 2021 10:11 am
Re: Export pdf with embedded fonts
Hello,
You can use the following code to add font to report resouces:
or this code to add font to StiFontCollection:
Thank you.
You can use the following code to add font to report resouces:
Code: Select all
var fileContent = System.IO.File.ReadAllBytes("Fonts/Roboto-Black.ttf");
var resource = new StiResource("Roboto-Black", "Roboto-Black", false, StiResourceType.FontTtf, fileContent, false);
report.Dictionary.Resources.Add(resource);
Code: Select all
Stimulsoft.Base.StiFontCollection.addOpentypeFontFile("calibri.ttf", "Calibri");