ApiShape

new ApiShape()

Class representing a shape.

Methods

Name Description
GetClassType

Returns the type of the ApiShape class.

GetContent

Returns the shape inner contents where a paragraph or text runs can be inserted.

GetDocContent

Deprecated in 6.2. Returns the shape inner contents where a paragraph or text runs can be inserted.

SetVerticalTextAlign

Sets the vertical alignment to the shape content where a paragraph or text runs can be inserted.

Example

Copy code
builder.CreateFile("pptx");
var oPresentation = Api.GetPresentation();
oPresentation.SetSizes(254 * 36000, 190 * 36000);
var oSlide = oPresentation.GetCurrentSlide();
oSlide.RemoveAllObjects();
var oFill = Api.CreateSolidFill(Api.CreateRGBColor(255, 111, 61));
var oStroke = Api.CreateStroke(0, Api.CreateNoFill());
var oShape = Api.CreateShape("flowChartOnlineStorage", 200 * 36000, 130 * 36000, oFill, oStroke);
oShape.SetPosition(608400, 1267200);
var oDocContent = oShape.GetDocContent();
oShape.SetVerticalTextAlign("bottom");
var oParagraph = Api.CreateParagraph();
oParagraph.SetJc("left");
oParagraph.AddText("We removed all elements from the shape and added a new paragraph inside it ");
oParagraph.AddText("aligning it vertically by the bottom.");
oDocContent.Push(oParagraph);
oSlide.AddObject(oShape);
builder.SaveFile("pptx", "ApiShape.pptx");
builder.CloseFile();

Resulting document