The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Hello,
What is the proper usage for the method:
Textnode.SizeToText(SizeF layoutArea)
I am current using it as:
textNode.SizeToText(new SizeF(1000f, 1000f));
My text nodes are generated using strings from a database, so the text node''s size is not pre-determined.
During performance analysis, I have noticed that this method takes up a significant chunk of processing (10%) so if you have any other ideas for determining text node size, please let me know.
Thanks,
Kevin
ADAdministrator Syncfusion Team October 13, 2005 04:01 PM UTC
Hi Kevin,
If you can, use the Symbol bounds for the layoutarea param when calling the TextNode.SizeToText(...) method. SizeToText(..) internally uses Graphics.MeasureString(String, Font, SizeF, StringFormat) to estimate the text bounds, and passes in the layoutarea as the maximum hint size. The performance draw within the SizeToText is probably due to the TextNode class attempting to calculate the text than can be accomodated on each line.
Thanks,
Prakash Surendra
Syncfusion Inc.,
ADAdministrator Syncfusion Team October 13, 2005 05:21 PM UTC
Prakash,
Thanks for the reply. There are actually no defined bounds for the symbol. If the text is 500 characters long then the TextNode will have to be made wide enough to accomodate the text, which in turn changes the bounds of its parent, the symbol.
This is not a problem by any means, and it looks like I have no choice but to use it for determining TextNode size.
Thanks for the information,
Kevin