Hi Team,
I am able extract the jpeg, png images using the following code. I am not able to extract the wmf ,visio drawing,chem draw images using shapes.
NodeCollection shapes = doc.getChildNodes(NodeType.SHAPE, true);
for (Shape shape : (Iterable)shapes)
{
if (shape.hasImage() && shape.getParentParagraph().getNextSibling() != null
&& shape.getParentParagraph().getPreviousSibling().getNodeType() == NodeType.SHAPE)
{
if (shape.getParentParagraph().getNextSibling().toString(SaveFormat.TEXT).startsWith("Fig"){
ArrayList nodes = extractContent(shape.getParentParagraph(), shape.getParentParagraph(), true);
filename = folder_name + "Fig" + i + "*" + name + ".docx";
generateDocument(doc, nodes).save(filename);
Paragraph fig = (Paragraph)shape.getParentParagraph().getNextSibling();
/***
** REMOVAL OF NODE(START,END) FROM SOURCE WORD DOC START*
***/
shape.getParentParagraph().insertBefore(new BookmarkStart(doc, "Image*" + i), shape);
fig.appendChild(new BookmarkEnd(doc, "Image_" + i));
i++;
for (Bookmark bookmark : doc.getRange().getBookmarks())
{
if (bookmark.getName().startsWith("Image_"))
{
bookmark.setText("");
}
}
Thanks in advance,
kind regards
Priyanga G