用docx4j,jar出去word书签,在word书签中插入文本
源码可以通过以下链接查看:
https://github.com/xulp-mzl/xlp-core
https://github.com/xulp-mzl/xlp-third
https://download.csdn.net/download/x15179220203xlp/9920651
实例:
public static void main(String[] args) throws Docx4JException {
DocxBookmarkTemplate docxBookmarkTemplate = new DocxBookmarkTemplate("f:/12.docx");
docxBookmarkTemplate.beforeInsertText("title", "收拾2hj").afterInsertText("space", "哈哈2")
.replaceText("id", "yee ").replaceText("textBox", "哈哈").replaceText("content1", "ss是");
docxBookmarkTemplate.save(new File("f:/13.docx"));
docxBookmarkTemplate.close();
}
1