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?


VB.NET

appreciate the response

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

AddBodySlide

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

AddDoubleBodySlide

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

AddEmptySlide

Adds the new empty Slide to a presentation.

AddHeaderSlide

Adds the new Slide with header placeholder to a presentation.

AddTitleSlide

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

http://www.aspose.com/Wiki/Default.aspx/Aspose.Slides/

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";

srcPres.Write("c:\\outHeaderText.ppt");

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?