解决POI3.10在添加图片的时候自身有一个BUG。纠结了很久都没解决,今天终于弄好了,文件包中附带了修改好的jar包bsj-poi-ooxml-3.10-FINAL-20140208.jar。主要问题是出在:org.apache.poi.xwpf.usermodel.XWPFRun.addPicture()函数 解决的是 // Pesky XmlBeans bug - see Bugzilla #49934 测试代码: HashMap map = new HashMap (); map.put("${name}", "李清清"); map.put("${tel}", "0851-xxxxxx"); map.put("${org}", "信息工程"); map.put("${userpic}", new Object[]{"d:\\p1.jpg",100,150}); String srcPath = "d:\\1.docx"; String destPath = "d:\\2.docx"; searchAndReplace(srcPath, destPath, map);