I also posted this message on stackoverflow:
I want to add an image to a XWPFDocument. I've created a memoryStream containing the image. (which is correct because If I render the base64 string from it, this is correct).
But if I add the image with the following code:
XWPFParagraph p2 = wordDoc.CreateParagraph();
XWPFRun r2 = p2.CreateRun();
r2.AddPicture(pictureData, (int)PictureType.PNG, "image1", 800, 600);
this results in the following error when I download the document:
“The file <document filename> cannot be opened because there are problems with the contents”
So my question is, what am I missing, what am I doing wrong? Couldn't find any documentation about images into a XWPF document.