Hi,
I am new to this forum and have been using docx4j for manipulating word documents. Recently, I have been have issues inserting image in a table cell (Tc). Here my code.
image = BinaryPartAbstractImage.createImagePart(WordprocessingMLPackage.createPackage(), imageByteArray);
CTSdtCell cell = (CTSdtCell)element.getValue();
JAXBElement cellElement = (JAXBElement)cell.getSdtContent().getContent().get(0);
// Get the cell from the CTSdtCell
Tc tableCell = (Tc)cellElement.getValue();
Inline inline = image.createImageInline("", "", 1,2,false);
P imageP = factory.createP();
R imageRun = factory.createR();
imageP.getContent().add(imageRun);
org.docx4j.wml.Drawing drawing = factory.createDrawing(); ...