Get Started
Usage API

SetPaddings

SetPaddings(nLeft, nTop, nRight, nBottom)

Set text paddings

Parameters:

Name Type Description
nLeft EMU
nTop EMU
nRight EMU
nBottom EMU

Returns:

This method doesn't return any data.

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oParagraph = oDocument.GetElement(0);
oFill = Api.CreateSolidFill(Api.CreateRGBColor(104, 155, 104));
oStroke = Api.CreateStroke(0, Api.CreateNoFill());
oDrawing = Api.CreateShape("rect", 3212465, 963295, oFill, oStroke);
oParagraph.AddDrawing(oDrawing);
oDocContent = oDrawing.GetDocContent();
oParagraph = Api.CreateParagraph();
oParagraph.AddText("This is a sample text with paddings set to it.");
oDocContent.Push(oParagraph);
oDrawing.SetPaddings(20 * 36000, 5 * 36000, 5 * 36000, 3 * 36000);
builder.SaveFile("docx", "SetPaddings.docx");
builder.CloseFile();

Resulting document