TRY NEW VERSION

Try now New API BETA

Try out the new view and capabilities of the API documentation

START

SetMultiline

SetMultiline(bMultiline) → { boolean }

Specifies if the current text field should be miltiline.

Parameters:

Name Type Description
bMultiline boolean

Defines if the current text field is multiline (true) or not (false).

Returns:

Type
boolean

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oTextForm = Api.CreateTextForm({"key": "Personal information", "tip": "Enter your first name", "required": true, "placeholder": "First name", "autoFit": false});
var oParagraph = oDocument.GetElement(0);
oParagraph.AddElement(oTextForm);
oTextForm.ToFixed(3 * 240, 3 * 240);
oTextForm.SetMultiline(true);
var bMultiline = oTextForm.IsMultiline();
oParagraph = Api.CreateParagraph();
oParagraph.AddText("The first text form from this document is multiline: " + bMultiline);
oDocument.Push(oParagraph);
builder.SaveFile("docx", "SetMultiline.docx");
builder.CloseFile();

Resulting document