[英]How to remove bullets in docx with Apache Poi?
我正在嘗試刪除文檔中的項目符號,只有項目符號而不是段落。
我的代碼是:
public void resultDocument(XWPFDocument document){
Headings sectionTools = new Headings();
List<ParagraphBySection> sectionListResult =
documentToMapComponent.fillParagraphBySection(sectionTools, document);
for(ParagraphBySection p : sectionListResult){
for(XWPFParagraph para: p.getParagraphs()){
if(para.getNumFmt() == "bullet"){
System.out.println(para.getText());
}
}
}
}
在 'if(para.getNumFmt() =="bullet")' 中正確識別了項目符號文本,但我必須刪除這些項目符號。
removeAbstractNum
公共 boolean removeAbstractNum(java.math.BigInteger abstractNumID)
刪除現有的 abstractNum
回報:
如果在 NumberingArray 中存在帶有 abstractNumID 的 abstractNum,則為 true;如果帶有 abstractNumID 的 abstractNum 不存在,則為 false
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.