Posted by a ceTe Software moderator
Hello,
Are you trying to add the indent to the paragraph? If so you will have to set indent to the paragraph using the Indent property of the Paragraph class. By default the indent will be set to zero and this is the reason you are seeing the same behavior for both of your examples. Below is the code to set indent for the paragraph.
FormattedTextAreaStyle style = new FormattedTextAreaStyle(FontFamily.Helvetica, 14, true);
string text="<p>Some text <br />with a soft linebreak </p>" ;
FormattedTextArea area = new FormattedTextArea(text, 10, 150, 200, 100, style);
string formattedText = "<p>Some text to check the paragraph</p><p>with a hard linebreak with HTML br tag and this should be added with some indent</p> ";
FormattedTextArea formattedTextArea = new FormattedTextArea(formattedText, 10, 10, 200, 100, FontFamily.Helvetica, 14, true);
formattedTextArea.Style.Paragraph.Indent = 20;
Document document = new Document();
Page page = new Page();
page.Elements.Add(formattedTextArea);
page.Elements.Add(area);
document.Pages.Add(page);
document.Draw(@"C:\Temp\Test.pdf");
Thanks,
ceTe Software Team.