Open CodingOctocat opened 4 years ago
I want to modify a docx file. I try code:
public static XWPFParagraph AppendCellParagraph(XWPFTableCell cell, string text, Color fg = default, Color bg = default) { var p = cell.AddParagraph(); XWPFRun run = p.CreateRun(); run.SetText(text); run.FontFamily = "宋体"; run.FontSize = 9; 👀 run.SetColor(ColorTranslator.ToHtml(fg)); p.AddRun(run); p.FillBackgroundColor = ColorTranslator.ToHtml(bg == default ? Color.Transparent : bg); p.Alignment = ParagraphAlignment.CENTER; p.VerticalAlignment = TextAlignment.CENTER; return p; }
Test found that the actual font size is 10.5.
I want to modify a docx file. I try code:
Test found that the actual font size is 10.5.