Get Started
Usage API
More information

Api

new Api()

Methods

Name Description
CreateBlipFill

Create a blip fill to apply to the object using a selected image as the object background.

CreateBullet

Create a bullet for a paragraph with the character or symbol specified with the sBullet parameter.

CreateChart

Create a chart with the parameters specified.

CreateGradientStop

Create a gradient stop used for different types of gradients.

CreateGroup

Create a group of drawings.

CreateImage

Create an image with the parameters specified.

CreateLinearGradientFill

Create a linear gradient fill to apply to the object using a selected linear gradient as the object background.

CreateNoFill

Create no fill and remove the fill from the element.

CreateNumbering

Create a bullet for a paragraph with the character or symbol specified with the sType parameter.

CreateParagraph

Create a new paragraph.

CreatePatternFill

Create a pattern fill to apply to fill the object using a selected pattern as the object background.

CreatePresetColor

Create a color selecting it from one of the available color presets.

CreateRadialGradientFill

Create a radial gradient fill to apply to the object using a selected radial gradient as the object background.

CreateRGBColor

Create an RGB color setting the appropriate values for the red, green and blue color components.

CreateRun

Create a new smaller text block to be inserted to the current paragraph or table.

CreateSchemeColor

Create a complex color scheme selecting from one of the available schemes.

CreateShape

Create a shape with the parameters specified.

CreateSlide

Create a new slide.

CreateSolidFill

Create a solid fill to apply to the object using a selected solid color as the object background.

CreateStroke

Create a stroke adding shadows to the element.

CreateTable

Create a table.

GetPresentation

Get the main presentation.

ReplaceTextSmart

Replaces each paragraph(or text in cell) in the select with the corresponding text from an array of strings.

Save

Save changes to the specified document.

Example

Copy code
builder.CreateFile("pptx");
oPresentation = Api.GetPresentation();
oSlide = Api.CreateSlide();
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);
oPresentation.AddSlide(oSlide);
oSlide = oPresentation.GetSlideByIndex(0);
oSlide.RemoveAllObjects();
oFill = Api.CreateSolidFill(Api.CreateRGBColor(61, 74, 107));
oStroke = Api.CreateStroke(0, Api.CreateNoFill());
oShape = Api.CreateShape("flowChartMagneticTape", 300 * 36000, 130 * 36000, oFill, oStroke);
oShape.SetPosition(608400, 1267200);
oDocContent = oShape.GetDocContent();
oParagraph = oDocContent.GetElement(0);
oParagraph.AddText("This is an example for base class methods.");
oBullet = Api.CreateNumbering("ArabicParenR", 1);
oParagraph = Api.CreateParagraph();
oParagraph.SetBullet(oBullet);
oParagraph.AddText(" A new slide was created.");
oDocContent.Push(oParagraph);
oParagraph = Api.CreateParagraph();
oParagraph.SetBullet(oBullet);
oParagraph.AddText(" The background of the new slide was set to pink.");
oDocContent.Push(oParagraph);
oParagraph = Api.CreateParagraph();
oParagraph.SetBullet(oBullet);
oParagraph.AddText(" A blue shape was created with numbered paragraphs in it.");
oDocContent.Push(oParagraph);
oSlide.AddObject(oShape);
builder.SaveFile("pptx", "Api.pptx");
builder.CloseFile();

Resulting document