这里只判断最后一页是否为空白页
final XWPFDocument xwpfDoc = new XWPFDocument(new FileInputStream("文件路径"));
final int pages = xwpfDoc.getProperties().getExtendedProperties().getUnderlyingProperties().getPages();
final XWPFParagraph paragraphArray = xwpfDoc.getParagraphArray(pages-1);
final String paragraphText = paragraphArray.getParagraphText();
if ( StringUtils.isEmpty(paragraphText){
空白页
document.removeBodyElement(pages-1);
}