Skip to main content

watermark_on_draw

An object containing the watermark properties.

Properties

NameTypeDescription
alignnumberThe vertical text align in the watermark shape: -0 - bottom, -1 - center, -4 - top.
fillnumber[] | stringThe watermark fill color in the RGB format, or the URL to image (base64 support: data:image/png;...). The empty array [] means that the watermark has no fill.
heightnumberThe watermark height measured in millimeters.
marginsnumber[]The text margins measured in millimeters in the watermark shape.
paragraphsobject[]The array with paragraphs from the current watermark with their properties.
paragraphs.alignnumberThe horizontal text align in the current paragraph: -0 - right, -1 - left, -2 - center, -3 - justify.
paragraphs.fillnumber[]The paragraph highlight in the RGB format. The empty array [] means that the paragraph is not highlighted.
paragraphs.linespacingnumberThe text linespacing in the current paragraph.
paragraphs.runsobject[]The array with runs from the current paragraph with their properties.
paragraphs.runs.boldbooleanDefines if the current text is displayed bold or not.
paragraphs.runs.fillnumber[]The text highlight in the RGB format. The empty array [] means that the text is not highlighted.
paragraphs.runs.font-familystringThe text font family.
paragraphs.runs.font-sizestringThe text font size measured in points (pt).
paragraphs.runs.italicbooleanDefines if the current text is displayed italic or not.
paragraphs.runs.strikeoutbooleanDefines if the current text is displayed struck through or not.
paragraphs.runs.textstringThe run text.
paragraphs.runs.underlinebooleanDefines if the current text is displayed underlined or not.
rotatenumberThe watermark rotation angle measured in degrees.
strokenumber[]The watermark stroke color in the RGB format. The empty array [] means that the watermark stroke has no fill.
stroke-widthnumberThe watermark stroke width measured in millimeters.
transparentnumberThe watermark transparency degree.
typestringThe shape which specifies the preset shape geometry for the current watermark.
widthnumberThe watermark width measured in millimeters.

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]);