/// <summary> /// Adds fixed-width text to a MigraDoc paragraph /// </summary> /// <param name="paragraph">The paragaraph to add text to</param> /// <param name="text">The text</param> private static void AddFixedWidthText(Paragraph paragraph, string text, int width) { //For some reason, a parapraph converts all sequences of white //space to a single space. Thus we need to split the text and add //the spaces using the AddSpace function. int numSpaces = width - text.Length; paragraph.AddSpace(numSpaces); paragraph.AddText(text); }