diff --git a/PdfService/Fonts/IRANSansWeb.ttf b/PdfService/Fonts/IRANSansWeb.ttf new file mode 100644 index 0000000..26ac25f Binary files /dev/null and b/PdfService/Fonts/IRANSansWeb.ttf differ diff --git a/PdfService/Reporter.cs b/PdfService/Reporter.cs index d07536d..4fe8046 100644 --- a/PdfService/Reporter.cs +++ b/PdfService/Reporter.cs @@ -1,5 +1,6 @@ +using Stimulsoft.Base; using Stimulsoft.Report; -using Stimulsoft.Report.Export; +using Stimulsoft.Report.Dictionary; namespace PdfService; @@ -11,6 +12,13 @@ public static class Reporter report.LoadFromString(reportTemplate); 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); var stream = new MemoryStream();