Create Presentation
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 usingadd_auto_shape
method exposed byshapes
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.
import aspose.slides as slides
# Instantiate a Presentation object that represents a presentation file
with slides.Presentation() as presentation:
slide = presentation.slides[0]
slide.shapes.add_auto_shape(slides.ShapeType.LINE, 50, 150, 300, 0)
presentation.save("NewPresentation_out.pptx", slides.export.SaveFormat.PPTX)