Reg adding notes in a powerpoint slide

hi ,

i am doing a project in which i need to add notes to powerpoint slide directly though code using java. the notes that needs to be added initially will be in an excel sheet. can you help in doing this?

regards,

vattikuti


This message was posted using Aspose.Live 2 Forum (private)

Dear vattikuti,

Thanks for considering Aspose.Slides for JAVA.

Here is a complete code example, which I have written for you that adds three lines of text inside the notes and illustrate how to add notes using Aspose.Slides for JAVA.

It is fully commented, you can also see the output presentation generated by this code which is attached by me.

Please also see, Working with Text from this link.

Adding Notes

JAVA

//Create a presentation
Presentation srcPres = new Presentation();

//Get first slide by position
//which is added by default
Slide sld = srcPres.getSlideByPosition(1);

//Add notes inside the slide
Notes _notes = sld.addNotes();

//Add some paragraphs inside the notes
Paragraphs paras = _notes.getParagraphs();

//Get the first para which is added by default
Paragraph firstPara = paras.get(0);

//Get the first portion which is added by default
Portion firstPortion = firstPara.getPortions().get(0);

//Set the text of the first port
firstPortion.setText("This is the first line in notes");

//Add one more paragraph, create copy of the first para
Paragraph newPara = new Paragraph(firstPara);
paras.add(newPara);

//Set its text
newPara.getPortions().get(0).setText("This is second line in notes");

//Now add one more paragraph but this time with bullet
Paragraph newPara2 = new Paragraph(firstPara);
paras.add(newPara2);
newPara2.setHasBullet((short) 1);
newPara2.getPortions().get(0).setText("This is third line in notes with bullet");

//Write presentation on disk
srcPres.write(new FileOutputStream("c:\\outNotes.ppt"));