Get Started
Plugins
Macros
More information

window.Asc.plugin.executeMethod ("SetProperties", [args], callback)

Description

Defines the method that allows setting the properties to the document.

Usage

This method should be used in the following way:

window.Asc.plugin.executeMethod ("SetProperties", [obj]);
Parameters
Parameter Description Type Example
obj A JSON object of the following form:
  • copyoutenabled disables copying from the editor if it is set to true,
    type: boolean,
    example: true;
  • hideContentControlTrack disables tracking the content control if it is set to true,
    type: boolean,
    example: true;
  • watermark_on_draw - a string value for watermark in json format,
    type: string,
    example: "{watermark}".
object
Returns

The method returns the undefined value.

Example
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%>"
                            }
                        ]
                            }
                        ]
    })
};
window.Asc.plugin.executeMethod("SetProperties", [initSettings]);