Rounded Rectangle shape insertion

Hi,

Can you guide me how I can add a rounded rectangle shape to a slide? I am using apose slides for java version 1.7

Thanks

Prashanth

Dear Prashanth,

I regret to inform you that there is no direct method to create Rectnagle Shape with round edges in PPT presentations using Aspose.Slides. Actuallly, the Rectangle Shape with rounded corners is an autoshape. The only way to create it is loading the previously serialized similar shape.

We are sorry for your inconvenience,

Hi,

Can a slide like the attached be created? An org chart but if you use auto shapes can the slide be created as attached

Thanks,

prashanth

Hello Prashanth,

I regret to share that you can generate the round edge rectangle in Aspose.Slides for .NET. However, I may suggest you to use the shared file as template and serialize the round edge rectangle shape from there and then add new shape by using the serialized shape in your presentation. In order to know how to add new shapes using serialization, please follow this link.

Thanks and Regards,

Hi,

Thanks for the reply, I have a problem now when I try to connect the shapes using elbow connector

with code below

Shape shp = slide.findShape("roundrect");
ByteArrayOutputStream bis=new ByteArrayOutputStream();
shp.serialize(bis);
//Add the shape into slide2
byte[] buf=null;
buf=bis.toByteArray();
ByteArrayInputStream bin=new ByteArrayInputStream(buf);
Shape shp2= slide2.getShapes().add(bin);
shp2.setX(1800);
shp2.setY(500);
shp2.setHeight(400);
TextFrame tf = shp2.getTextFrame();
tf.setText("t");
ByteArrayInputStream bin1=new ByteArrayInputStream(buf);
Shape shp3= slide2.getShapes().add(bin1);
shp3.setX(500);
shp3.setY(1200);
shp3.setHeight(400);
TextFrame tf1 = shp3.getTextFrame();
tf1.setText("t1");

Connector conn4= slide2.getShapes().addConnector(ConnectorType.ELBOW, new java.awt.geom.Point2D.Float(2000, 650),new java.awt.geom.Point2D.Float(1000, 1350));
LineFormat lf9 = conn4.getLineFormat();
lf9.setForeColor(new java.awt.Color(146,208,80));
lf9.setWidth(1.5f);
lf9.setEndArrowheadStyle(LineArrowheadStyle.TRIANGLE);
conn4.connectBegin(shp2,2);
conn4.connectEnd(shp3,3);

The connector does not connect the shape end points correctly but when you move the shapes they get connected/aligned properly. please suggest

Thanks,

prashanth

Dear Prashanth,

I have worked with the code snippet shared by you and have been able to generate the correct form of connection between the shapes. I have used Aspose.Slides for Java 2.4.0. For your kind reference, I have also shared the generated presentation.

Thanks and Regards,

Hi,

Can you confirm that this works with apose.slides 1.7 for Java or what changes do I need to make to make it work with that version?

Thanks A Lot

Prashanth

Dear Prashant,

I have investigated the code snippet with Aspose.Slides for Java 1.7.0 and it seems to be a problem in the generated presentation. However, this issue has been fixed in Aspose.Slides for Java 2.4.0, which is available for download here. Please try the mentioned product version and hopefully the issue will be resolved.

Thanks and Regards,