We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to add frames in slides (C# .NET)


I am looking for a way to Add Frames around all the slides of a presentation, like PowerPoint offers.

I am trying to add frames as per my code, but in my output the frame is not formatted properly.

Is there an option I am missing to add frames or to change the formatting of the frame I am adding?

I included the pic from PowerPoint (expected), the output from my code (actual), my code and original document in attached zip:
Frame.zip (96.5 KB)



I have observed your requirements and have also observed the sample code and generated PDF. The code sample seems fine for adding shape of frame type. Can you please share actual expected output that you are looking in Aspose.Slides to offer you. From Aspose.Slides perspective, you can set the line properties as well and coordinates of frame shape as per your requirements.

Hi @mudassir.fayyaz

Thanks for your response. The expected output is the same as in the FromPowerPoint.JPG.
I processed this into expected.pdf.


Frame (2).zip (619.3 KB)


I have shared sample code with you. This will help you to achieve your requirements. Please share feedback with us if there is still an issue.

using (Presentation press = new Presentation(“Pres.pptx”))

IMasterSlide mSlide = press.Masters[0];
var shape = mSlide.Shapes.AddAutoShape(ShapeType.Rectangle, 0, 0, press.SlideSize.Size.Width, press.SlideSize.Size.Height, false);

shape.LineFormat.Width = 1;
shape.LineFormat.FillFormat.FillType = FillType.Solid;
shape.LineFormat.FillFormat.SolidFillColor.Color = Color.Black;
press.Save("Presout.pptx", SaveFormat.Pptx);


1 Like