poi word设置字体背景颜色(也叫底纹)

XWPFRun run = getRun(para, 13, "微软雅黑", null);//"EEAD0E"
CTRPr pRpr = run.getCTR().getRPr();
if(pRpr == null){
         pRpr = run.getCTR().addNewRPr();  
}
CTShd shd = pRpr.isSetShd() ? pRpr.getShd() : pRpr.addNewShd();  
shd.setVal(STShd.Enum.forInt(38));  
shd.setColor("FFFF00");  
run.setText("xxx");

参考
https://www.iteye.com/blog/53873039oycg-2157758

你可能感兴趣的:(java)