how to add shapes in word document using apache poi library

550 Views Asked by At

I need to add below shapes available in MS word using Apache poi library.

I am not able to find any specific class/method available for word to add such shapes.

However, I can find some method to add shapes in excel from apache.

 XSSFDrawing patriarch= (XSSFDrawing) sheet3.createDrawingPatriarch();
 XSSFClientAnchor regionr = patriarch.createAnchor(0, 0, 1, 1, (short)6, 12, (short)8.95, 12);
 XSSFSimpleShape region1Shapevr = patriarch.createSimpleShape(regionr);
 region1Shapevr.setShapeType(ShapeTypes.LINE); 

Can you please suggest if there is any similar class/method available or other approach to add shapes as well in word document.

0

There are 0 best solutions below