public CellStyle(short[] padding = null, string font = "Times New Roman", int fontSize = 12, MyJustification justification = MyJustification.Left, MyTypographicalEmphasis emphasis = MyTypographicalEmphasis.Normal, short colspan = 1) { Font = font; FontSize = fontSize; Justification = justification; Emphasis = emphasis; Colspan = colspan; if (padding is null) { padding = new short[] { 0, 0, 0, 0 } } ; Padding = padding; } }
public void AddParagraph(string text, int textSize, string font, MyTypographicalEmphasis typoEmp, MyJustification justification) { RunProperties runProp = GetRunProperties(font, textSize, typoEmp); Run run = new Run(runProp, new Text(text)); ParagraphProperties paraProp = new ParagraphProperties(new Justification() { Val = justification == MyJustification.Left ? JustificationValues.Left : justification == MyJustification.Right ? JustificationValues.Right : JustificationValues.Center }); Paragraph paragraph = new Paragraph(paraProp, run); body.AppendChild(paragraph); }