Add speaker notes PPTX

Hello. Is it possible to add speaker notes to slides in pptx presentations? I have found examples where you can read existing file and update speaker notes. But in my case i want to create new presentation and add notes to it inside my application.

Hi,

I have observed the requirements shared by you and like to share that Aspose.Slides offers the feature for adding the slide notes in PPTX. Please use the following sample code to serve the purpose. Please share, if I may help you further in this regard.


PresentationEx pres = new PresentationEx();

//Access the first slide

SlideEx sld = pres.getSlides().get_Item(0);

//Creating Slide note instance

NotesSlideEx note = sld.getNotesSlide();

//Casting to autoshape

AutoShapeEx shp1 = (AutoShapeEx)note.getShapes().get_Item(1);

//Accessing autoshape’s text frame

TextFrameEx txt1 = shp1.getTextFrame();

//Updating Slide notes
txt1.setText(“Text has Changed”);

pres.write(“D://ppt//notext.pptx”);

Man Thanks,

Thanks for your answer.

I’m trying your example (and tried something like that before i’ve wrote this post) and get sld.getNotesSlide() = null and NullPointerException on note.getShapes().
Do you have any ideas what is wrong?

Hi,

Please try using the following sample code on your end and share your feedback if there is still an issue.


PresentationEx pres = new PresentationEx();

//Access the first slide

SlideEx sld = pres.getSlides().get_Item(0);

sld.addNotesSlide();
//Creating Slide note instance

NotesSlideEx note = sld.getNotesSlide();

//Casting to autoshape

AutoShapeEx shp1 = (AutoShapeEx)note.getShapes().get_Item(1);

//Accessing autoshape’s text frame

TextFrameEx txt1 = shp1.getTextFrame();

//Updating Slide notes
txt1.setText(“Text has Changed”);

pres.write(“D://Aspose Data//notext.pptx”);

Many Thanks,

It works now. Thanks a lot!