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

Free Support Forum - aspose.com

Make a pptx presentation

Can anyone please tell me how to make a pptx presentation through code?
I only want to add a new image to one whole slide. How do i add a picture?

Hi,

Thanks for your interest in Aspose.Slides.

Please use the code snippet below for creating a PPTX file with an image inside its slide.

PresentationEx pres = new PresentationEx();
int Index = pres.Slides.AddEmptySlide(pres.LayoutSlides[0]);
SlideEx slide = pres.Slides[0];

//Read the image from disk
Image img = Bitmap.FromFile("D:\\ppt\\125.jpg");

//Add the image inside the presentation
//and save the extendend image object for later use
ImageEx imgEx = pres.Images.AddImage(img);

//Add the picture frame with extended image
slide.Shapes.AddPictureFrame(ShapeTypeEx.Rectangle, 60, 70, 600, 400, imgEx);

//Write the presentation on disk
pres.Write("D:\\ppt\\output.pptx");

Thanks and Regards,

This shows an error :
Error reading “/ppt/theme/theme1.xml” xml part

may i know what is this error?

Hi,

Thanks for your interest in Aspose.Slides.

Please share some more details about the problem you are facing. Have you added the reference to Aspose.Slides.dll. Pleas verify this.

Thanks and Regards,

yes i have added the reference to aspose.slides (the latest version downloadable) from aspose.com. Any help?

Hi,

Thanks for your interest in Aspose.Slides.

If possible, can you please share the sample project. This way, we will try to figure out your problem.

We are sorry for the inconvenience.