Transparent Rectangle share with text

Hi,


I want to create a rectangular shape which is transparent and has bulleted text in it.

// Add an AutoShape of Rectangle type
IAutoShape ashp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 10, 50, 200, 50);
// Add TextFrame to the Rectangle
ashp.addTextFrame(“First Slide Title”);
ashp.getFillFormat().setFillType((byte)com.aspose.slides.FillType.NoFill);

The above code creates a rectangle with white background but I am not able to see the text “First Slide Title” in it.

Please suggest.

Hi Deepak,


Thank you for your interest in Aspose.Slides.

I have observed your comments and have made necessary changes to the code as per your requirements. I request you to please visit this link for your kind reference and please try using following sample code on your end to serve the purpose.

Presentation p = new Presentation();
ISlide sld = p.getSlides().get_Item(0);
// Add an AutoShape of Rectangle type
IAutoShape ashp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 10, 50, 200, 50);
// Add TextFrame to the Rectangle
ashp.addTextFrame(“First Slide Title”);
IPortion port = ashp.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0);
IPortionFormat pf = port.getPortionFormat();
pf.getFillFormat().setFillType(FillType.Solid);
pf.getFillFormat().getSolidFillColor().setColor(Color.black);
ashp.getFillFormat().setFillType(FillType.NoFill);
p.save(“D:\test.pptx”, SaveFormat.Pptx);


I hope this will be helpful. Please share if I may help you further in this regard.

Best Regards,