SetVerticalTextAlign
Sets the vertical alignment to the shape content where a paragraph or text runs can be inserted.
Syntax
expression.SetVerticalTextAlign(verticalAlign);
expression - A variable that represents a ApiShape class.
Parameters
| Name | Required/Optional | Data type | Default | Description |
|---|---|---|---|---|
| verticalAlign | Required | VerticalTextAlign | The type of the vertical alignment for the shape inner contents. |
Returns
boolean
Example
Set the vertical alignment to the shape content where a paragraph or text runs can be inserted in a document.
// How to align the text of the shape to top in a document.
// Set vertical text align to top in a document.
let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
let fill = Api.CreateSolidFill(Api.RGB(255, 111, 61));
let stroke = Api.CreateStroke(0, Api.CreateNoFill());
let drawing = Api.CreateShape("rect", 3212465, 963295, fill, stroke);
paragraph.AddDrawing(drawing);
let docContent = drawing.GetContent();
let classType = drawing.GetClassType();
paragraph = Api.CreateParagraph();
paragraph.AddText("Class Type = " + classType);
docContent.AddElement(0, paragraph);
drawing.SetVerticalTextAlign("top");