Skip to main content

fillForms

An object containing the form properties.

Properties

NameTypeDescription
tagsobjectThe form tags which specify the content for each form type with such a tag.
tags.checkBoxstringThe checkbox form value (-true - checked, -false - unchecked).
tags.comboBoxstringThe combo box form value (one of the items from the combo box list values).
tags.picturestringThe image form value (a link to the image).
tags.textstringThe text field value (some text).

Type

Object

Example

var initSettings = {
"copyoutenabled" : false,
"hideContentControlTrack" : false,
"watermark_on_draw" : JSON.stringify({
"transparent" : 0.3,
"type" : "rect",
"width" : 100,
"height" : 100,
"rotate" : -45,
"margins" : [ 10, 10, 10, 10 ],
"fill" : [255, 0, 0],
"stroke-width" : 1,
"stroke" : [0, 0, 255],
"align" : 1,

"paragraphs" : [ {
"align" : 2,
"fill" : [255, 0, 0],
"linespacing" : 1,

"runs" : [
{
"text" : "Do not steal, %user_name%!",
"fill" : [0, 0, 0],
"font-family" : "Arial",
"font-size" : 40,
"bold" : true,
"italic" : false,
"strikeout" : false,
"underline" : false
},
{
"text" : "<%br%>"
}
]
}
]
}),
"disableAutostartMacros" : true,
"fillForms" : JSON.stringify({
"tags" : {
"111" : {
"text" : "Text in form with tag 111",
"checkBox" : "true",
"picture" : "https://upload.wikimedia.org/wikipedia/commons/9/91/ONLYOFFICE_logo.png",
"comboBox" : "item1"
},
"222" : {
"text" : "Text in form with tag 222",
"checkBox" : "false",
"comboBox" : "item2"
},
"333" : {
"text" : "OnlyOffice"
}
}
})
};
window.Asc.plugin.executeMethod("SetProperties", [initSettings]);