TextArea space between lines

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v7)  /  Re: TextArea space between lines

DynamicPDF CoreSuite for .NET (v7) Forum

 Jul 22 2013 11:42 AM
On a TextArea object, do I have control over how much vertical white space is taken between lines? I'd like to eliminate some of the white space that is being taken up.

Thank you,

-Scott
 Jul 22 2013 12:04 PM
Posted by a ceTe Software moderator
Hello Scott,

Yes, you can control the spacing between the text lines within TextArea without any problem using our DynamicPDF Generator for .NET product. You will need to use the Leading property of the TextArea class to do this. Below is the sample code for it.

            Document document = new Document();
            Page page = new Page();
            string text = "This is to test line leading";
            for (int i = 0; i < 5; i++)
            {
                text += text;
            }
            TextArea area = new TextArea(text, 100, 100, 200, 200);
            area.Leading = 10;
            area.Height = area.GetRequiredHeight();
            page.Elements.Add(area);
            document.Pages.Add(page);
            document.Draw(@"C:\Mydocument.pdf");

Thanks,
ceTe Software Support Team.

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