- Code: Select all
List<Object> paragraphs = getAllElementFromObject(template.getMainDocumentPart(),P.class);
for(Object objP:paragraphs) {
P para = (P) objP;
/***/
List<Object> texts = getAllElementFromObject(para,Text.class);
List<Object> brs = getAllElementFromObject(para,Br.class);
if(brs.size()==1 && checkPageBreak((Br)brs.get(0)) && texts.size()== 0)
remove(template.getMainDocumentPart().getContent(), para);
}
But this removing use-full page ...