I am using the Leading property for TextArea to control vertical line spacing. Is there a similar way to control the line spacing for a FormattedTextArea?
Thanks!
-Scott
Leading for FormattedTextArea?
Re: Leading for FormattedTextArea?
Support · Sep 16, 2013Hello Scott,
Yes, you can set the leading for the text lines within the FormattedTextArea without any problem using our DynamicPDF Generator for .NET. You will need to set the leading and leading type using Leading and LeadingType properties.Below is the sample code for it.
Document document = new Document();
Page page = new Page();
document.Pages.Add(page);
FormattedTextAreaStyle style = new FormattedTextAreaStyle(FontFamily.Helvetica, 12, true);
string formattedText = "<p>This is to test for setting line leading using FormattedTextArea of DynamicPDF for .NET product API</p>";
FormattedTextArea formattedTextArea = new FormattedTextArea(formattedText, 0, 150, 256, 400, style);
formattedTextArea.Style.Line.Leading = 20;
formattedTextArea.Style.Line.LeadingType = LineLeadingType.Exactly;
page.Elements.Add(formattedTextArea);
document.Draw(@"C:\MyDocument.pdf");
Thanks,
ceTe Software Support Team.