Create Presentation - C++ PowerPoint API
Contents
[
Hide
]
Create PowerPoint Presentation
To add a simple plain line to a selected slide of the presentation, please follow the steps below:
- Create an instance of Presentation class.
- Obtain the reference of a slide by using its Index.
- Add an AutoShape of Line type using the AddAutoShape method exposed by Shapes object.
- Write the modified presentation as a PPTX file.
In the example given below, we have added a line to the first slide of the presentation.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-slides/Aspose.Slides-for-C | |
// The path to the documents directory. | |
const String outPath = u"../out/SampleChartresult.pptx"; | |
//Instantiate Presentation class that represents PPTX file | |
SharedPtr<Presentation> pres = MakeObject<Presentation>(); | |
SharedPtr<ISlide> slide = pres->get_Slides()->idx_get(0); | |
// Add an autoshape of type line | |
slide->get_Shapes()->AddAutoShape(Aspose::Slides::ShapeType::Line, 50.0, 150.0, 300.0, 0.0); | |
//Saving presentation | |
pres->Save(outPath, Aspose::Slides::Export::SaveFormat::Pptx); | |