Issue on extract anchor images

Dear Team,

I have extracted the images from the document. I’ve extracted the images(i.e Normal images & tables images). But anchor images are not extracted. how to extract the anchor image. please suggest me.

Input Document: 2021GH000538-file001.docx (251.0 KB)

Please do the needful.


@Mahesh39 Your document does not contain images, but it contain charts. You can use ShapeRenderer to convert them to image. For example you can use code like the following to extract the charts from your document as images:

Document doc = new Document("C:\\Temp\\in.docx");
Iterable<Shape> shapes = doc.getChildNodes(NodeType.SHAPE, true);
int counter = 0;
for (Shape s : shapes)
    if (s.hasChart())
        String fileName = "C:\\Temp\\chart_" + (counter++) + ".png";
        s.getShapeRenderer().save(fileName, new ImageSaveOptions(SaveFormat.PNG));