标签:段落 use 样式 ttext rri 对齐 doc family nbsp
//新建段落
XWPFParagraph p1 = doc.CreateParagraph();
//对齐方式
p1.SetAlignment(ParagraphAlignment.LEFT);
p1.SetVerticalAlignment(TextAlignment.AUTO);
//Word边框样式
p1.SetBorderBottom(Borders.DOUBLE);
p1.SetBorderTop(Borders.DOUBLE);
p1.SetBorderRight(Borders.DOUBLE);
p1.SetBorderLeft(Borders.DOUBLE);
p1.SetBorderBetween(Borders.SINGLE);
//新建文字
XWPFRun rUserHead = p1.CreateRun();
//文字内容
rUserHead.SetText("员工 : ");
//颜色
rUserHead.SetColor("4F6B72");
//大小
rUserHead.SetFontSize(15);
//是否加粗
rUserHead.SetBold(true);
//字体
rUserHead.SetFontFamily("宋体");
//是否有下划线
//r1.SetUnderline(UnderlinePatterns.DotDotDash);
//位置
rUserHead.SetTextPosition(20);
//增加换行
rUserHead.AddCarriageReturn();
标签:段落 use 样式 ttext rri 对齐 doc family nbsp
原文地址:https://www.cnblogs.com/buchizaodian/p/9455728.html