i want to replace a image with another image in word07,my code is
public static byte insertPicToDocx(InputStream in,List<ByteArrayInputStream> fushionChartList,List<String> chartIndicatorType)throws Exception
{
LoadFromZipNG z = new LoadFromZipNG();
WordprocessingMLPackage wordMLPackage = (WordprocessingMLPackage)z.get(in);
MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();
wordMLPackage.getParts().get(new PartName("/word/_rels/document.xml.rels"));
/**2011-5-25 新图的ID+图的描述**/
final HashMap<String,String> picMap=new HashMap<String,String>();
/**2011-5-25 将所有生成的图片绑定到文档**/
for(int i=0;i<fushionChartList.size();i++)
{
BinaryPartAbstractImage imagePart = BinaryPartAbstractImage.createImagePart(wordMLPackage, getBytesFromFile(fushionChartList.get(i)));
picMap.put(imagePart.getSourceRelationship().getId(), chartIndicatorType.get(i));
}
org.docx4j.wml.Document wmlDocumentEl = documentPart.getJaxbElement();
Body body = wmlDocumentEl.getBody();
new TraversalUtil(body,
new Callback()
{
String indent = "";
public ...