addSlide
addSlide
BASIC / ADVANCED / PREMIUM
Inserts a new slide into the PowerPoint presentation.
Description
public addSlide($options = array())
This method allows the creation of new slides in the PowerPoint presentation.
The layout of the first slide when creating a presentation from scratch is set to 'Title Slide'. This layout can be customized in the new CreatePptx class:
Parameters
options
Key | Type | Description |
---|---|---|
active | bool | If true set as internal active slide. Default as false. |
cleanLayoutParagraphContents | bool | If false do not remove paragraph contents from the layout. Default as true. |
cleanSlidePlaceholderTypes | array |
Placeholder types to be cleaned from the layout. Default as: dt, ftr, hdr, sldNum. Allowed types:
|
layout | string |
Layout (name) to be used. If not set, the layout from the active slide is used. Default layouts:
|
position | int | Slide position. 0 is the first slide. -1 (last) as default. If section is set, use this position to add the slide in the section. |
section | int | Section to add the slide. 0 is the first section. -1 is the last section. If not set, the slide is not added in a section. |
Exceptions
The layout name doesn't exist.
Code samples
Release notes
- phppptx 3.0:
- cleanLayoutParagraphContents option.
- phppptx 2.0:
- position and section options.
- phppptx 1.0:
- new method.