Get Started
Documentation

GetSlideByIndex

GetSlideByIndex(nPos) → {ApiSlide}

Get the slide by its position in the presentation.

Parameters:

Name Type Description
nPos number The slide number (position) in the presentation.

Returns:

Type
ApiSlide

Example

Copy code
builder.CreateFile("pptx");
var oPresentation = Api.GetPresentation();
var oSlide = oPresentation.GetSlideByIndex(0);
oGs1 = Api.CreateGradientStop(Api.CreateRGBColor(255, 224, 204), 0);
oGs2 = Api.CreateGradientStop(Api.CreateRGBColor(255, 164, 101), 100000);
oFill = Api.CreateRadialGradientFill([oGs1, oGs2]);
oSlide.SetBackground(oFill);
builder.SaveFile("pptx", "GetSlideByIndex.pptx");
builder.CloseFile();

Resulting document