Set Slide Title using Apache POI and Aspose.Slides
Contents
[
Hide
]
Aspose.Slides - Set Slide Title
Below example shows how title can be set using Aspose.Slides.
//Create a presentation
Presentation pres = new Presentation();
//Add the title slide
ISlide slide = pres.getSlides().addEmptySlide(pres.getLayoutSlides().get_Item(0));
//Set the title text
((IAutoShape)slide.getShapes().get_Item(0)).getTextFrame().setText("Slide Title Heading");
//Set the sub title text
((IAutoShape)slide.getShapes().get_Item(1)).getTextFrame().setText("Slide Title Sub-Heading");
Apache POI SL - HSLF XSLF - Set Slide Title
Title can be set by calling addTitle method of SlideShow class using Apache POI SL.
SlideShow ppt = new SlideShow();
Slide slide = ppt.createSlide();
TextBox title = slide.addTitle();
title.setText("Hello, World!");
Download Running Code
Download Sample Code
For more details, visit Manage TextBox.