TRY NEW VERSION

Try now New API BETA

Try out the new view and capabilities of the API documentation

START

SetTextPr

SetTextPr(oTextPr) → { boolean }

Inherited From: ApiFormBase#SetTextPr

Sets the text properties to the current form. Used if possible for this type of form

Parameters:

Name Type Description
oTextPr ApiTextPr

The text properties that will be set to the current form.

Returns:

Type
boolean

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oCheckBoxForm = Api.CreateCheckBoxForm({"key": "Marital status", "tip": "Specify your marital status", "required": true, "placeholder": "Marital status", "radio": true});
var oParagraph = oDocument.GetElement(0);
oParagraph.AddElement(oCheckBoxForm);
var oTextPr = Api.CreateTextPr();
oTextPr.SetFontSize(30);
oTextPr.SetBold(true);
oCheckBoxForm.SetTextPr(oTextPr);
oParagraph.AddText(" Married");
oParagraph.AddLineBreak();
oCheckBoxForm = Api.CreateCheckBoxForm({"key": "Marital status", "tip": "Specify your marital status", "required": true, "placeholder": "Marital status", "radio": true});
oParagraph.AddElement(oCheckBoxForm);
oParagraph.AddText(" Single");
oCheckBoxForm.SetTipText("Specify your marital status");
builder.SaveFile("docx", "SetTextPr.docx");
builder.CloseFile();

Resulting document