Skip to main content

CreateWordArt

Creates a Text Art object with the parameters specified.

Syntax

expression.CreateWordArt(textPr, text, transform, fill, stroke, rotAngle, width, height);

expression - A variable that represents a Api class.

Parameters

NameRequired/OptionalData typeDefaultDescription
textPrOptionalApiTextPrApi.CreateTextPr()The text properties.
textOptionalstring"Your text here"The text for the Text Art object.
transformOptionalTextTransform"textNoShape"Text transform type.
fillOptionalApiFillApi.CreateNoFill()The color or pattern used to fill the Text Art object.
strokeOptionalApiStrokeApi.CreateStroke(0, Api.CreateNoFill())The stroke used to create the Text Art object shadow.
rotAngleOptionalnumberfalseRotation angle.
widthOptionalEMU1828800The Text Art width measured in English measure units.
heightOptionalEMU1828800The Text Art heigth measured in English measure units.

Returns

ApiDrawing

Example

This example creates a Text Art object with the "textArchUp" text transform type.

let doc = Api.GetDocument();
let textPr = Api.CreateTextPr();
textPr.SetFontSize(30);
textPr.SetBold(true);
textPr.SetCaps(true);
textPr.SetColor(51, 51, 51, false);
textPr.SetFontFamily("Comic Sans MS");
let fill = Api.CreateSolidFill(Api.CreateRGBColor(255, 111, 61));
let stroke = Api.CreateStroke(1 * 36000, Api.CreateSolidFill(Api.CreateRGBColor(51, 51, 51)));
let textArt = Api.CreateWordArt(textPr, "onlyoffice", "textArchUp", fill, stroke, 0, 150 * 36000, 50 * 36000);
let paragraph = doc.GetElement(0);
paragraph.AddDrawing(textArt);