Page 1 of 1

GrowToHeight not repositioning other text fields

Posted: Wed Sep 07, 2022 6:06 am
by JoshS
I am trying to solve a problem with GrowToHeight. I have a number of text fields running top to bottom. One of these can have a long value.

In the preview everything below gets pushed down, which is what I expect:
Image

However, when I run this export via C# render to PDF it doesn't work correctly:
Image

When I tried this on my actual report, even worse than this, it just overlaps the fields:
Image

I have attached a repro case. This is using Stimulsoft.Reports.Engine.NetCore 2022.3.5.

Re: GrowToHeight not repositioning other text fields

Posted: Wed Sep 07, 2022 9:32 am
by Kirill Klimenkov
Hello.

We have reproduced the issue and need some time to make an improvement.
We will let you know when we get any results.
For now you can use the next code to switch graphics engine:

Code: Select all

Stimulsoft.Drawing.Graphics.GraphicsEngine = Stimulsoft.Drawing.GraphicsEngine.Gdi;
Thank you.
#7975

Re: GrowToHeight not repositioning other text fields

Posted: Thu Sep 08, 2022 12:26 am
by JoshS
Thanks Kirill.

Am I right in thinking that Gdi engine is only supported on Windows hosted services and will not work under Linux containers for example?

Re: GrowToHeight not repositioning other text fields

Posted: Thu Sep 08, 2022 8:12 am
by Kirill Klimenkov
Hello.

It will work on .NET 5.0 with libgdiplus library. For .NET 6.0 it should work with the same library but there may be some issues.
https://www.stimulsoft.com/en/blog/arti ... ting-tools

Thank you.

Re: GrowToHeight not repositioning other text fields

Posted: Wed Sep 28, 2022 2:05 am
by JoshS
Kirill Klimenkov wrote: Thu Sep 08, 2022 8:12 am Hello.

It will work on .NET 5.0 with libgdiplus library. For .NET 6.0 it should work with the same library but there may be some issues.
https://www.stimulsoft.com/en/blog/arti ... ting-tools

Thank you.
Thanks Kirill.

I've tried it with libgdiplus under Linux and I can render the report however it's not picking up my TTF files now.

Code: Select all

var fontBytesBold = await File.ReadAllBytesAsync($"{Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory)}/Reports/ClientInvoice/NotoSansCJKscBold.ttf"); ;
var fontBytesRegular = await File.ReadAllBytesAsync($"{Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory)}/Reports/ClientInvoice/NotoSansCJKscRegular.ttf");

StiFontCollection.AddFontBytes(fontBytesBold, "Noto Sans CJK SC Black", System.Drawing.FontStyle.Bold);
StiFontCollection.AddFontBytes(fontBytesRegular, "Noto Sans CJK SC Medium", System.Drawing.FontStyle.Regular);
There's no errors, the fonts are being loaded fine, but they are not being used in the rendered PDF. This works on Windows fine, and also works fine on Linux in the default ImageSharp renderer too.

Does the GDI renderer only support OTF fonts? I tried OTF and that seemed to work, but the file size was much larger (3MB vs. ~400KB for TTF).

Re: GrowToHeight not repositioning other text fields

Posted: Wed Sep 28, 2022 2:07 am
by JoshS
Kirill Klimenkov wrote: Thu Sep 08, 2022 8:12 am Hello.

It will work on .NET 5.0 with libgdiplus library. For .NET 6.0 it should work with the same library but there may be some issues.
https://www.stimulsoft.com/en/blog/arti ... ting-tools

Thank you.
Thanks Kirill.

I've tried it with libgdiplus under Linux and I can render the report however it's not picking up my TTF files now.

Code: Select all

var fontBytesBold = await File.ReadAllBytesAsync($"{Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory)}/Reports/ClientInvoice/NotoSansCJKscBold.ttf"); ;
var fontBytesRegular = await File.ReadAllBytesAsync($"{Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory)}/Reports/ClientInvoice/NotoSansCJKscRegular.ttf");

StiFontCollection.AddFontBytes(fontBytesBold, "Noto Sans CJK SC Black", System.Drawing.FontStyle.Bold);
StiFontCollection.AddFontBytes(fontBytesRegular, "Noto Sans CJK SC Medium", System.Drawing.FontStyle.Regular);
There's no errors, the fonts are being loaded fine, but they are not being used in the rendered PDF. This code works on Windows fine, and also works fine on Linux in the default ImageSharp renderer too.

Does the GDI renderer only support OTF fonts? I tried OTF and that seemed to work, but the file size was much larger (3MB vs. ~400KB for TTF).

Re: GrowToHeight not repositioning other text fields

Posted: Wed Sep 28, 2022 12:48 pm
by Kirill Klimenkov
Hello.

Please check the Embedded Fonts property is enabled.

Thank you.

Re: GrowToHeight not repositioning other text fields

Posted: Thu Nov 03, 2022 10:11 pm
by JoshS
Kirill Klimenkov wrote: Wed Sep 07, 2022 9:32 am Hello.

We have reproduced the issue and need some time to make an improvement.
We will let you know when we get any results.
For now you can use the next code to switch graphics engine:

Code: Select all

Stimulsoft.Drawing.Graphics.GraphicsEngine = Stimulsoft.Drawing.GraphicsEngine.Gdi;
Thank you.
#7975
Hi Kirill, is there any update on this issue?

Re: GrowToHeight not repositioning other text fields

Posted: Fri Nov 04, 2022 6:33 am
by Kirill Klimenkov
Hello.​​

We are still working on the issue.
We will let you know when we get any result.

Thank you.

Re: GrowToHeight not repositioning other text fields

Posted: Wed Oct 04, 2023 11:40 pm
by Lech Kulikowski
Hello,

The issue is fixed. The fix will be available in the next release 2023.4.1 within one week.

Thank you.