SetPlaceholderText

SetPlaceholderText(sText) → { boolean }

Sets the placeholder text to the current form. Can't be set to checkbox or radio button.

Parameters:

Name Type Description
sText string

The text that will be set to the current form.

Returns:

Type
boolean

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oPictureForm = Api.CreatePictureForm({"key": "Personal information", "tip": "Upload your photo", "required": true, "placeholder": "Photo", "scaleFlag": "tooBig", "lockAspectRatio": true, "respectBorders": false});
var oParagraph = oDocument.GetElement(0);
oParagraph.AddElement(oPictureForm);
oPictureForm.SetImage("https://api.onlyoffice.com/content/img/docbuilder/examples/user-profile.png", 60 * 36000, 35 * 36000);
oPictureForm.SetPlaceholderText("Picture form");
builder.SaveFile("docx", "SetPlaceholderText.docx");
builder.CloseFile();

Resulting document