Setting line height

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v6)  /  Re: Setting line height

DynamicPDF CoreSuite for .NET (v6) Forum

 Jun 11 2012 4:16 PM
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?
 Jun 12 2012 10:18 AM
Posted by a ceTe Software moderator
Hello,

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.

All times are US Eastern Standard time. The time now is 2:44 AM.