GetTextPr

GetTextPr() → { ApiTextPr }

Inherited From: ApiFormBase#GetTextPr

Returns the text properties from the current form. This method is used only for text and combo box forms.

Parameters:

This method doesn't have any parameters.

Returns:

Type
ApiTextPr

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oComboBoxForm = Api.CreateComboBoxForm({"key": "Personal information", "tip": "Choose your country", "required": true, "placeholder": "Country", "editable": false, "autoFit": false, "items": ["Latvia", "USA", "UK"]});
var oParagraph = oDocument.GetElement(0);
oParagraph.AddElement(oComboBoxForm);
var oTextPr = Api.CreateTextPr();
oTextPr.SetFontSize(30);
oTextPr.SetBold(true);
oComboBoxForm.SetTextPr(oTextPr);
var oFormTextPr = oComboBoxForm.GetTextPr();
oFormTextPr.SetItalic(true);
oComboBoxForm.SetTextPr(oFormTextPr);
builder.SaveFile("docx", "GetTextPr.docx");
builder.CloseFile();

Resulting document