I'm having a problem with line breaks inside a formatted text area.
I have a formatted text area and insert some text with line breaks into it. However, sometimes the text entered does not fit into the area (There are too many lines). The problem that occurs here is that extra lines are removed from the text rather than just those that are outside of the textarea.
Here is some example code:
Document document = new Document();
ceTe.DynamicPDF.Page page = new ceTe.DynamicPDF.Page();
Rectangle rect = new Rectangle(100, 100, 100, 100);
rect.FillColor = new RgbColor(255, 0, 0);
FormattedTextArea text = new FormattedTextArea("Test<br>Test<br>Test<br>Test<br>Test", 100, 100, 100, 100, FontFamily.Helvetica, 20, true);
page.Elements.Add(rect);
page.Elements.Add(text);
document.Pages.Add(page);
document.DrawToWeb();
This code results in the last two 'Test' lines being removed when only the last one is actually outside the textarea.
Thanks,
Richard
FormattedTextArea line break issue
Re: FormattedTextArea line break issue
Support · Jul 27, 2009Hello Richard,
We are able to see the behavior with the last line and we will forward this issue over to the developers to look into it further. We will post a message as soon as we hear something from them.
Thanks,
ceTe Software Support Team.
Re: FormattedTextArea line break issue
Support · Jul 28, 2009Hello Richard,
The behavior you are seeing with the last line is correct. In order to see the last line in the same area you will have to set the AllowOrphanLines property of the paragraph to true. Below is the code for this.
formattedTextArea.Style.Paragraph.AllowOrphanLines = true;
Thanks,
ceTe Software Support Team.
Re: FormattedTextArea line break issue
Forum member · Jul 28, 2009That works perfectly.
Thanks,
Richard