Hi Team,
I wanted to know the following code snippets using aspose slide . I am using java and aspose slides version 3.0
1) How to create group objects in slides?
2) How to remove shapes from group objects?
3) How to add shapes in group objects?
4) I have group objects which includes one ole object and other shapes. When I increased width of the group, only ole shape width is increased not other shapes.
Can you help me to achieve the above requirements.
Thanks.
Hi Senthil Kumar,
public static void MangeGroupShape() throws Exception{// Instantiate PresentationEx class that represents PPTXPresentationEx pres = new PresentationEx(“D:\Aspose Data\TestGroup.pptx”);// Access first slideSlideEx sld = pres.getSlides().get_Item(0);// Iterate through shapes to find the placeholderfor (int i = 0; i < sld.getShapes().size(); i++){ShapeEx shp=sld.getShapes().get_Item(i);if(shp instanceof GroupShapeEx){//Getting AutoShape from group shapes setGroupShapeEx gShape = (GroupShapeEx)shp;int ind=gShape.getShapes().addAutoShape(ShapeTypeEx.Rectangle,300,200,100,100 );ind=gShape.getShapes().addAutoShape(ShapeTypeEx.Ellipse,600,300,100,100 );//Now see how to remove the shape from group shapegShape.getShapes().removeAt(1);System.out.println("Shapes inside group shape: "+Integer.toString(gShape.getShapes().getCount()));}}// Write the PPTX to Diskpres.write(“D:\Aspose Data\GroupShape.pptx”);}