line spacing RRS feed


  • Hi Ch3ls3a1,

    You can add paragraph properties to the paragraph that you want to format. The paragraph properties contains the information about line spacing. Below is the code snippet which generate a paragraph formated as double line spacing:

        // Creates an Paragraph instance and adds its children.
        public Paragraph GenerateParagraph()
          Paragraph paragraph1 = new Paragraph(){ RsidParagraphAddition = "003F01E1", RsidParagraphProperties = "00761641", RsidRunAdditionDefault = "003F01E1" };
          ParagraphProperties paragraphProperties1 = new ParagraphProperties();
          SpacingBetweenLines spacingBetweenLines1 = new SpacingBetweenLines(){ Line = "480", LineRule = LineSpacingRuleValues.Auto };
          Run run1 = new Run();
          Text text1 = new Text();
          text1.Text = "On the Insert tab, the galleries include items that are designed to coordinate with the overall look of your document. You can use these galleries to insert tables, headers, footers, lists, cover pages, and other document building blocks. When you create pictures, charts, or diagrams, they also coordinate with your current document look.";
          return paragraph1;

    Hope this code can help you.

    Best Regards,

    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Bruce Song Friday, May 27, 2011 10:07 AM
    Tuesday, May 3, 2011 9:02 AM