I'm trying to create two columns of content on a PDF (that flow) - but have various sections of text with headings.
I've found the linegap on the headers is too much (since it's a larger font size + bold). I can adjust the line height for the entire text area - but, I only want it to apply to a specific style (bold).
Is there a way to do this?
Setting line height
Re: Setting line height
Support · Jun 12, 2012Hello,
You can set leading to specific lines using our DynamicPDF Generator for .NET product. You will need to use the FormattedTextArea page element and <line> tag to do this. You can set the Leading and LeadingType attributes of line tag. 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>Formatted text area provide rich formatting support for text that " +
"appears in the document. You have complete control over 8 paragraph properties: " +
"spacing before, spacing after, first line indentation, left indentation, right " +
"indentation, alignment, allowing orphan lines, and white space preservation; 6 " +
"font properties: <font face='Times'>font face, </font><font " +
"pointSize='6'>font size, </font><font color='FF0000'>color, " +
"</font><b>bold, </b><i>italic and </i><u>" +
"underline</u>; <line leading='8' leadingType='exactly'> and 2 line properties: leading, and leading type.</line> Text can " +
"also be rotated.</p>";
FormattedTextArea formattedTextArea = new FormattedTextArea(formattedText, 0, 0, 256, 400, style);
page.Elements.Add(formattedTextArea);
document.Draw(@"C:\MyDocument.pdf");
Thanks,
ceTe Software Support Team.