Posted 2 December 2021, 1:10 am EST
Hello,
We have a code which had been working for a long time before we upgraded to v15.2.1 from v10 and the MeasureParagraphHeight(string strText, float width, Font textFont,StringFormat strFormat) method started returning SizeF with values (Height = 0, Width = 0) for some reason. The simplified code snippet:
private static RectangleF ResizeRectangle(Page curPage, TextBox textBox, string text, RectangleF rect)
{
var page = (Page)curPage.Clone();
SizeF sizeText;
if (textBox.CanGrow)
{
sizeText = page.MeasureParagraphHeight(text, rect.Width, textBox.Font, StringFormat.GenericTypographic);
if (sizeText.Height > rect.Height)
{
rect.Height = sizeText.Height;
}
}
return rect;
}
P.S. This code is executed while Format event.