Compare commits
1 Commits
master
...
AddingFont
| Author | SHA1 | Date | |
|---|---|---|---|
| 48377344a4 |
BIN
PdfService/Fonts/IRANSansWeb.ttf
Normal file
BIN
PdfService/Fonts/IRANSansWeb.ttf
Normal file
Binary file not shown.
@@ -1,5 +1,6 @@
|
|||||||
|
using Stimulsoft.Base;
|
||||||
using Stimulsoft.Report;
|
using Stimulsoft.Report;
|
||||||
using Stimulsoft.Report.Export;
|
using Stimulsoft.Report.Dictionary;
|
||||||
|
|
||||||
namespace PdfService;
|
namespace PdfService;
|
||||||
|
|
||||||
@@ -11,6 +12,13 @@ public static class Reporter
|
|||||||
|
|
||||||
report.LoadFromString(reportTemplate);
|
report.LoadFromString(reportTemplate);
|
||||||
report.RegBusinessObject("Data", data);
|
report.RegBusinessObject("Data", data);
|
||||||
|
|
||||||
|
var currentDirectory = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, @"../../.."));
|
||||||
|
var fileContent = File.ReadAllBytes(Path.Combine(currentDirectory, "Fonts", "IRANSansWeb.ttf"));
|
||||||
|
var resource = new StiResource("IRANSansMonoSpacedNum", "IRANSansMonoSpacedNum", false, StiResourceType.FontTtf, fileContent, false);
|
||||||
|
report.Dictionary.Resources.Add(resource);
|
||||||
|
StiFontCollection.AddResourceFont(resource.Name, resource.Content, "ttf", resource.Alias);
|
||||||
|
|
||||||
report.Render(false);
|
report.Render(false);
|
||||||
|
|
||||||
var stream = new MemoryStream();
|
var stream = new MemoryStream();
|
||||||
|
|||||||
Reference in New Issue
Block a user