java poi 操作word wps模式下无法生成 页眉和页脚

CTSectPr sectPr = doc.getDocument().getBody().addNewSectPr();
XWPFHeaderFooterPolicy headerFooterPolicy = new XWPFHeaderFooterPolicy(doc,sectPr);
XWPFHeader header = headerFooterPolicy.createHeader(XWPFHeaderFooterPolicy.DEFAULT);
XWPFParagraph paragraph = header.createParagraph();
paragraph.setBorderBottom(Borders.THICK);
paragraph.setAlignment(ParagraphAlignment.CENTER);
paragraph.getCTP().addNewPPr().addNewRPr().set(xmlToken);

                    在WPS下无法生成页眉,在MS word下是正常。页脚也同样是这种情况。求解答
查看全部
wodemusic
寻找W宝石
2020/05/12 19:27
  • java
  • 点赞
  • 收藏
  • 回答
    私信

2个回复