I want to put an image in e header. I have used the docx4j webapp to generate the java code of the header. But for the image webapp application suggest to use
- Code: Select all
org.docx4j.openpackaging.parts.WordprocessingML.ImageJpegPart
So I have write this:
- Code: Select all
File img = new File("logo.jpeg");
InputStream is = new BufferedInputStream(new FileInputStream(img));
ImageJpegPart imgJpgPart = new ImageJpegPart(new PartName("/word/media/image1.jpeg"));
imgJpgPart.setBinaryData(is);
wordMLPackage.getParts().put(imgJpegPart);
but when I open my document like a ZIP there no image... anyone have a example please?
Thanks a lot