Free Support Forum - aspose.com

Line spacing in paragraphs

Is there a way to set the line spacing for a paragraph to Single? I do not see an option for it in the LineSpacingRule enumeration (perhaps I am attempting my goal using the wrong method --> docBldr.ParagraphFormat.LineSpacing = LineSpacingRule.Multiple; ).
This message was posted using Aspose.Live 2 Forum

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. You can use the following simple code to achieve this:

DocumentBuilder builder = new DocumentBuilder();

builder.ParagraphFormat.LineSpacingRule = LineSpacingRule.Multiple;

// One line equals 12 points.

builder.ParagraphFormat.LineSpacing = 12;

builder.Write("This is paragraph with single line spacing");

builder.Document.Save(@"Test001\out.doc");

Hope this helps.

Best regards.