Get Started
Usage API
More information

ScaleWidth

ScaleWidth(coefficient) → { bool }

Scale the width of the graphic object using the specified coefficient.

Parameters:

Name Type Description
coefficient number

The coefficient by which the figure height will be scaled.

Returns:

Type
bool

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oParagraph = oDocument.GetElement(0);
for (i = 1; i < 4; i++ ){
    oFill = Api.CreateSolidFill(Api.CreateRGBColor(104, 155, 104));
    oStroke = Api.CreateStroke(0, Api.CreateNoFill());
    oDrawing = Api.CreateShape("cube", 963295, 963295, oFill, oStroke);
    oParagraph.AddDrawing(oDrawing);
    oDrawing.ScaleWidth( i );
}
builder.SaveFile("docx", "ScaleWidth.docx");
builder.CloseFile();

Resulting document