- Code: Select all
BinaryPartAbstractImage imagePart = BinaryPartAbstractImage.createImagePart(_package, bytes);
Inline inline = imagePart.createImageInline(null, null, id1, id2, false);
// Now wrap the inline in w:p/w:r/w:drawing
P p = _objFactory.createP();
R run = _objFactory.createR();
p.getParagraphContent().add(run);
org.docx4j.wml.Drawing drawing = _objFactory.createDrawing();
run.getRunContent().add(drawing);
drawing.getAnchorOrInline().add(inline);
_documentPart.addObject(p);
My question is, for the create image inline call, id1 & 2 are supposed to be unique ids:
id1 - An id unique in the document
id2 - Another id unique in the document
So, is there a class/method somewhere to query what the next available IDs are? Or do have to track / figure it out manually?
Does it matter if they are not unique? In the example the same values for id1 & 2 are reused several times.
Thanks,
LokiTC