3

I have a Paragraph object from the C# library DocX and am trying in vain to set the LineSpacing property but it has no effect?

internal static Paragraph StandardFormat(this Paragraph p)
{
    p = p.FontSize(12);

    p.LineSpacing = 1.5f;

    return p;
}
fiat
  • 15,501
  • 9
  • 81
  • 103

1 Answers1

4

I don't know what the LineSpacing property is for but that was a red herring. The fix was to use the SetLineSpacing method:

internal static Paragraph StandardFormat(this Paragraph p)
{
    p = p.FontSize(12);

    p.SetLineSpacing(LineSpacingType.Line, 1.5f);

    return p;
}
fiat
  • 15,501
  • 9
  • 81
  • 103
  • 1
    You saved my day man! Thank you very much! One more thing, try all the LineSpacingType options, in my case LineSpacingType.After solved my problem – Mirko Bellabarba Apr 06 '16 at 08:44