For AI agents: the complete documentation index is available at /pptxgenjs-plus/llms.txt, the full documentation bundle is available at /pptxgenjs-plus/llms-full.txt, and this page is available as Markdown at /pptxgenjs-plus/usage-add-slide.md.

Adding a Slide

Syntax

Create a new slide in the presentation:

let slide = pptx.addSlide();

Returns

The addSlide() method returns a reference to the created Slide object, so method calls can be chained.

let slide1 = pptx.addSlide();
slide1
  .addImage({ path: "img1.png", x: 1, y: 2 })
  .addImage({ path: "img2.jpg", x: 5, y: 3 });

You can also create multiple slides:

let slide1 = pptx.addSlide();
slide1.addText("Slide One", { x: 1, y: 1 });

let slide2 = pptx.addSlide();
slide2.addText("Slide Two", { x: 1, y: 1 });

Slide Methods

See Slide Methods for features such as Background and Slide Numbers.

Slide Masters

To use a layout with predefined logos, margins, or styles, see Slide Masters for instructions on creating and applying slide masters.