Api
Methods
Name |
Description |
attachEvent |
Subscribes to the specified event and calls the callback function when the event fires. |
CreateBlipFill |
Creates a blip fill to apply to the object using the selected image as the object background. |
CreateBullet |
Creates a bullet for a paragraph with the character or symbol specified with the sSymbol parameter. |
CreateChart |
Creates a chart with the parameters specified. |
CreateGradientStop |
Creates a gradient stop used for different types of gradients. |
CreateGroup |
Creates a group of drawings. |
CreateImage |
Creates an image with the parameters specified. |
CreateLayout |
Creates a new slide layout and adds it to the slide master if it is specified. |
CreateLinearGradientFill |
Creates a linear gradient fill to apply to the object using the selected linear gradient as the object background. |
CreateMaster |
Creates a new slide master. |
CreateNoFill |
Creates no fill and removes the fill from the element. |
CreateNumbering |
Creates a bullet for a paragraph with the numbering character or symbol specified with the sType parameter. |
CreateOleObject |
Creates an OLE object with the parameters specified. |
CreateParagraph |
Creates a new paragraph. |
CreatePatternFill |
Creates a pattern fill to apply to the object using the selected pattern as the object background. |
CreatePlaceholder |
Creates a new placeholder. |
CreatePresetColor |
Creates a color selecting it from one of the available color presets. |
CreateRadialGradientFill |
Creates a radial gradient fill to apply to the object using the selected radial gradient as the object background. |
CreateRGBColor |
Creates an RGB color setting the appropriate values for the red, green and blue color components. |
CreateRun |
Creates a new smaller text block to be inserted to the current paragraph or table. |
CreateSchemeColor |
Creates a complex color scheme selecting from one of the available schemes. |
CreateShape |
Creates a shape with the parameters specified. |
CreateSlide |
Creates a new slide. |
CreateSolidFill |
Creates a solid fill to apply to the object using a selected solid color as the object background. |
CreateStroke |
Creates a stroke adding shadows to the element. |
CreateTable |
Creates a table. |
CreateTextPr |
Creates the empty text properties. |
CreateTheme |
Creates a new presentation theme. |
CreateThemeColorScheme |
Creates a new theme color scheme. |
CreateThemeFontScheme |
Creates a new theme font scheme. |
CreateThemeFormatScheme |
Creates a new theme format scheme. |
CreateWordArt |
Creates a Text Art object with the parameters specified. |
detachEvent |
Unsubscribes from the specified event. |
FromJSON |
Converts the specified JSON object into the Document Builder object of the corresponding type. |
GetPresentation |
Returns the main presentation. |
ReplaceTextSmart |
Replaces each paragraph (or text in cell) in the select with the corresponding text from an array of strings. |
Save |
Saves changes to the specified document. |
Example
Copy code
builder.CreateFile("pptx");
var oPresentation = Api.GetPresentation();
var oSlide = Api.CreateSlide();
var oGs1 = Api.CreateGradientStop(Api.CreateRGBColor(255, 213, 191), 0);
var oGs2 = Api.CreateGradientStop(Api.CreateRGBColor(255, 111, 61), 100000);
var oFill = Api.CreateRadialGradientFill([oGs1, oGs2]);
oSlide.SetBackground(oFill);
oPresentation.AddSlide(oSlide);
oSlide = oPresentation.GetSlideByIndex(0);
oSlide.RemoveAllObjects();
oFill = Api.CreateSolidFill(Api.CreateRGBColor(255, 111, 61));
var oStroke = Api.CreateStroke(0, Api.CreateNoFill());
var oShape = Api.CreateShape("flowChartMagneticTape", 300 * 36000, 130 * 36000, oFill, oStroke);
oShape.SetPosition(608400, 1267200);
var oDocContent = oShape.GetDocContent();
var oParagraph = oDocContent.GetElement(0);
oParagraph.AddText("This is an example for base class methods.");
var 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 orange.");
oDocContent.Push(oParagraph);
oParagraph = Api.CreateParagraph();
oParagraph.SetBullet(oBullet);
oParagraph.AddText(" An orange shape was created with numbered paragraphs in it.");
oDocContent.Push(oParagraph);
oSlide.AddObject(oShape);
builder.SaveFile("pptx", "Api.pptx");
builder.CloseFile();
Resulting document