How to get anchored images in document with para node

Dear Team.,

How to find and get anchored images in word document using para node.I have attached sample document for anchored image using para node input.zip (2.7 MB).

Need solution for anchored image mean result is true else false.

Please give solution for this scenario.

Regards.,
S S Vadivel

@Vadivel_S_S,

Thanks for your inquiry. The images can be placed in your document in two ways either inline or floating. Please use the following code example to check the wrap type of image. Hope this helps you.

Document doc = new Document(MyDir + "Input.doc");
for (Paragraph paragraph : (Iterable<Paragraph>) doc.getChildNodes(NodeType.PARAGRAPH, true))
{
    for (Shape shape : (Iterable<Shape>) paragraph.getChildNodes(NodeType.SHAPE, true))
    {
        if(shape.hasImage())
        {
            System.out.println(shape.getWrapType() != WrapType.INLINE);
        }
    }
}