Free Support Forum -

More examples/documentation

Any chance you are going to add more examples of creating presentations
from scratch? I looked at the examples on the wiki and the ones
in the java download and there are no straight forward examples to show
adding a couple of slide and adding multiple lines to the slide.

I put in the “hello world” example and that worked fine, but when I
attempted to add some additional line with ‘\n’ it crashed. I did
search the fourm and found something similar, but the answer on how to
simply add more lines was not there.

Also is there a way to use a blank template slide with a standard
corporate format and just create new slides of that slide and add new
data (not search or replace). The template example looks like you
are reading the slide that was brought in and finding markers on the
slide to change the data out.


If you create a Slide Master in powerpoint with the header/footer the way you like it and just leave a single blank slide in the presentation and save it as template.ppt you can simply just open that presentation and duplicate that first slide to keep the header/footer the same. Just make sure to write the presentation to a different file (or stream) and you're all set.

The most reliable way i've found to add line breaks is to seperate things into seperate paragraphs when you want a new line. You can do that with the Paragraphs.Add object of the TextFrame.

I use code that goes something like this: (Note this is c# not java, but it should work the same)

Aspose.Slides.Rectangle description = slide.Shapes.AddRectangle(2875,725,2750,1000);


para = new Paragraph();

para.Portions.Add(new Portion("DESCRIPTION TEXT HERE"));