1 Commits

Author SHA1 Message Date
48377344a4 Added IRANSansWeb font as resource 2025-07-07 14:00:41 +03:30
5 changed files with 10 additions and 44 deletions

View File

@@ -1,25 +0,0 @@
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/.idea
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md

View File

@@ -1,11 +0,0 @@
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
COPY . .
RUN --mount=type=cache,id=nuget,target=/root/.nuget/packages \
dotnet publish --self-contained false -o /app
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final
WORKDIR /app
COPY --from=build /app .
ENTRYPOINT ["dotnet", "PdfService.dll"]

Binary file not shown.

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net10.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup> </PropertyGroup>
@@ -11,10 +11,4 @@
<PackageReference Include="Stimulsoft.Reports.Engine.NetCore" Version="2025.2.3" /> <PackageReference Include="Stimulsoft.Reports.Engine.NetCore" Version="2025.2.3" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Include="..\.dockerignore">
<Link>.dockerignore</Link>
</Content>
</ItemGroup>
</Project> </Project>

View File

@@ -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();