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

Free Support Forum - aspose.com

How to add slides dynamically?

How do I add slides to a presentation dynamically based on number of records in a database?


appreciate the response

To add slide dynamically in the presentation, you can use any of these methods of Aspose.Slides.Presentation object.


Adds the new Slide with header and body placeholders to a presentation.


Adds the new Slide with header and two body placeholders to a presentation.


Adds the new empty Slide to a presentation.


Adds the new Slide with header placeholder to a presentation.


Adds the new Slide with header and subheader placeholders to a presentation.

Ok maybe I should have been more specific…

How do I add a slide dynamically with data from the database.

Example… setting the header to a database value.

For general information, please read Aspose.Slides Wiki


Try this code

Presentation srcPres = new Presentation();

Slide srcSld = srcPres.GetSlideByPosition(1);

srcSld.HeaderFooter.IsHeaderVisible = true;

srcSld.HeaderFooter.HeaderText = "HeaderText";

srcSld.HeaderFooter.IsFooterVisible = true;

srcSld.HeaderFooter.FooterText = "footerText";


I tried the code above but I can not see header text in the output. I’m using Aspose.Slides v2.8.4.0 (.NET) and MS PPT 2007.

Is there any problem with header text?