Hello
I need a more detailed clarification how the HasOverflowText method works
Please see an example
var formattedTextArea = new FormattedTextArea("VVVV", indent, 0, 1000, 0, style);
formattedTextArea.Height = 1.32;
Why doesn't formattedTextArea.HasOverflowText return TRUE? The text can't be fit here because the height is too small
Best regards, Yuriy
FormattedTextArea & HasOverflowText
Re: FormattedTextArea & HasOverflowText
Support · Aug 1, 2011Hello,
The FormattedTextArea page element will add minimum one line of text by default even if you set the height to zero. If you are left with any text after adding one line of text then HasOverflowText method will return Boolean as true. Below is the sample code for it.
Document doc = new Document();
Page page = new Page();
FormattedTextArea formattedTextArea = new FormattedTextArea("Hello world", 100, 200, 50, 100, FontFamily.Helvetica, 12, true);
formattedTextArea.Height = 1.35F;
float ht = formattedTextArea.Height;
bool isTextThere = formattedTextArea.HasOverflowText();
page.Elements.Add(formattedTextArea);
doc.Pages.Add(page);
doc.Draw(@"C:\Temp\Test.pdf");
Thanks,
ceTe Software Support Team.
Re: FormattedTextArea & HasOverflowText
Forum member · Aug 1, 2011It's odd but thank you for the clarification.
Best regards, Yuriy
Re: FormattedTextArea & HasOverflowText
Forum member · Aug 1, 2011It's odd but thank you for the clarification.
Best regards, Yuriy