Masters and Placeholders
Slide Masters
Most production presentations must follow a defined design or corporate branding. pptxgenjs supports this through Slide Master Layouts, which are defined as plain objects and applied to slides, allowing a Master Slide to be created entirely in code.
Create a Slide Master by calling the defineSlideMaster() method with an options object (the same style
used for Slides). Once defined, pass the Master title to addSlide() and that Slide will use the Layout
previously defined.
Defined Masters become first-class Layouts in the exported PowerPoint presentation. They can be edited via View > Slide Master, and such edits affect all Slides created with that layout.
Properties
Slide Master Props (SlideMasterProps)
Background Props (BackgroundProps)
SlideNumber Props (SlideNumberProps)
NOTES
- Slide Number: more props are available than shown above -
SlideNumberPropsinherits from TextProps - Pre-encode images (base64) and add the string as the optional data key/val (see
bkgdabove)
Examples
Slide Master Example
Slide Master Example Output
Using the 'MASTER_SLIDE' defined above to produce a Slide:

Placeholders
Placeholders are supported in pptxgenjs.
Add a placeholder object to a Master Slide using a unique name, then reference that placeholder
name when adding text or other objects.
Placeholder Types
Placeholder Example
Placeholder Example Output
Using the 'PLACEHOLDER_SLIDE' defined above to produce a Slide:

More Examples
A presentation built from several defined Master Slides, including placeholder examples:
