How to retain pre-existing fonts?

Hi, I have just started my work on using ASPOSE Slides for Java, I have a power point, Im using this as a template to fill contents dynamically, when I do a setText on my Table cells, the fonts are changed, I wanted the preset fonts for the Table to be unchanged, how do I achieve this?

Secondly, I need to know if there is a good document describing the hierarchy and relationship between, Presentation, Slide, PlaceHolders, Shapes...yada yada yada

Any help is appreciated.

Thanks

Srini

Dear Srini,

As a new to Aspose.Slides, you should read Developer Guide Section on Aspose.Slides Wiki from the link below

Initially, when you create presentation from scratch, there is one font Arial in the Presentation.getFonts() collection by default. To add new fonts, you create a FontEntity object and add it into the fonts collection and then note its index, then you change the index by TextFrame.getParagraphs().get(0).getPortions().get(0).setFontIndex method.

For more information please see these two posts, there is a code in C#, map it into Java, which is very easy, because both .NET and Java have exactly same APIs only difference is that Java properties start with set or get prefixes

I am able to create new fonts and add them to my presentation, how do I set the font size?

example: font: Arial, fontsize :12pts

Use Portion.FontHeight property.

yeah, figured that out...

okay, I have a text with newline [\n] characters, when I do a portion.setText, I get an exception

Can't assign string which contains paragraph break character, what is the best way to deal with strings that have new line characters?

Thanks

Srini

I handled the above one by replacing \n with <>

now, I have text like [see below], how can I break a new line at all occurences of <>, or, how do I start a new bullet at every <>?

Application Services team<>Project Manager for Source N-1<>Database support group<>

Dear Srini,

For each new line, you will add a new paragraph.

For example, this is a sample text with two paragraphs and two portions inside them with different settings

Sample Text

This is first Paragraph.\nThis is second Paragraph.

Now you will split it on basis of new line character and get two strings

This is first Paragraph.

This is second Paragraph.

The next code will look like this.

Paragraph para=new Paragraph(“”);

Portion port=para.getPortions().get(0);

port.setText(“This is”);

Portion anotherPort=new Portion(port);

anotherPort.setText(“first Paragraph.”);

anotherPort.setFontBold(true);

//Add the paragraph into TextFrame.getParagraphs() collection

tf.getParagraphs().add(para);

//Repeat the same for “This is second Paragraph.

To show bullet before the paragaph, please see this link.