SetPosition
Specify the amount by which text is raised or lowered for this paragraph in relation to the default
baseline of the surrounding non-positioned text.
Parameters:
Name |
Type |
Description |
nPosition |
hps
|
Specifies a positive (raised text) or negative (lowered text)
measurement in half-points (1/144 of an inch). |
Returns:
- Type
-
ApiParagraph
Example
Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oParagraph = oDocument.GetElement(0);
oParagraph.AddText("This is just a sample text. ");
oParagraph_2 = Api.CreateParagraph();
oParagraph_2.SetPosition(-5);
oParagraph_2.AddText("This is a paragraph with the text lowered 5 points (10 half-points).");
oDocument.Push(oParagraph_2);
builder.SaveFile("docx", "SetPosition.docx");
builder.CloseFile();