We're sorry Aspose doesn't work properply without JavaScript enabled.

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


<?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");


Hope this helps.

Best regards.