Page 2 of 3

Re: Problem with PDF export in k8s, windows 2019

Posted: Fri Mar 04, 2022 1:55 pm
by e.andrukh
I made adding fonts like this and correct font is used, but as you said in one style only. Waiting for fix.

Code: Select all

			foreach (var file in System.IO.Directory.GetFiles("C:\\Windows\\Fonts"))
			{
				Stimulsoft.Base.StiFontCollection.AddFontFile(file);
			}

Re: Problem with PDF export in k8s, windows 2019

Posted: Fri Mar 04, 2022 2:23 pm
by Lech Kulikowski
Hello,

The next release build will be available within two or three weeks.

Thank you.

Re: Problem with PDF export in k8s, windows 2019

Posted: Mon Mar 07, 2022 2:05 pm
by e.andrukh
Hello,
I upgraded to latest version and found one more issue:
Image is not exported.
Not reproduced anymore

Re: Problem with PDF export in k8s, windows 2019

Posted: Mon Mar 07, 2022 10:14 pm
by Lech Kulikowski
Hello,

We couldn't connect to your database. Please send us test data for your report.

Thank you.

Re: Problem with PDF export in k8s, windows 2019

Posted: Tue Mar 22, 2022 2:19 pm
by e.andrukh
Hello, I updated to v2022.2.1
But it still has wrong fonts.
Pdf is attached.

Before update problem was with wrong style of font: italic was used instead of general one.

Now it's different.

Re: Problem with PDF export in k8s, windows 2019

Posted: Tue Mar 22, 2022 3:23 pm
by e.andrukh
By the way attached three fonts cannot be added to StiFontCollection

Code: Select all

StiFontCollection.AddFontFile(fileName)
System.ArgumentNullException: Value cannot be null.
Parameter name: key
at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
at Stimulsoft.Base.StiFontCollection.AddContentToCache(Byte[] content, String extension, String alias, Nullable`1 fontStyle, Boolean isResource)
at Stimulsoft.Base.StiFontCollection.AddFontFile(String fileName, String alias, Nullable`1 fontStyle)

Re: Problem with PDF export in k8s, windows 2019

Posted: Wed Mar 23, 2022 12:33 pm
by Lech Kulikowski
Hello,

We need some additional time to investigate the issue, we will let you know about the result.

Thank you.

Re: Problem with PDF export in k8s, windows 2019

Posted: Wed Mar 23, 2022 8:39 pm
by Lech Kulikowski
Hello,

> By the way attached three fonts cannot be added to StiFontCollection

The issue is fixed. The fix will be available in the next release build.

> Before update problem was with wrong style of font: italic was used instead of general one.
> I updated to v2022.2.1
> But it still has wrong fonts.

Not really. The fonts now exported to PDF are correct, and the styles are correct.
But there is a problem with the character width.
Analysis of the pdf file shows that this is another GDI bug - the character width of the wrong font is returned.
Try setting the following static option:
StiOptions.Export.Pdf.AllowInvokeWindowsLibraries = false;
and let us know about the result.

Thank you.

Re: Problem with PDF export in k8s, windows 2019

Posted: Thu Mar 24, 2022 9:19 am
by e.andrukh
It solves the problem, thanks.

I copied all Windows fonts to C:\Windows\Fonts.
This code is used before reports rendering and exporting:

Code: Select all

			StiOptions.Export.Pdf.AllowInvokeWindowsLibraries = false;

			foreach (var fileName in Directory.GetFiles(@"C:\Windows\Fonts"))
			{
				try
				{
					StiFontCollection.AddFontFile(fileName);
				}
				catch (Exception ex)	{ }
			}

Re: Problem with PDF export in k8s, windows 2019

Posted: Thu Mar 24, 2022 9:23 am
by e.andrukh
Maybe it can be helpful, how fonts are copied and registered in docker image:

Code: Select all

FROM mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2019

COPY ./Fonts ./Fonts
COPY ./InstallFonts.ps1 ./Fonts
RUN ["powershell.exe", "./Fonts/InstallFonts.ps1"]