TrophyCustomer's Canvas is honored with a 2020 InterTech Technology Award! Learn more 

Command: setPrintArea

This is an equivalent of the setPrintAreas method from IFrame API, but only for one surface (either a specified surface or the current surface).

Unlike changeLayout command, the design is loaded completely, including the background.

Params

  • data - the same print area definition as used in the setPrintAreas.
  • surfaceIndex - which surface to replace. If omitted, the currently visible surface is modified.
  • options - history management options. See the setPrintAreas docs for more details.

Example

{
    "type": "canvas", 
    "name": "editor",
    "params": {
        "initial": { ... }, 
        "setPrintArea": {
            "discardChanges": false,
            "data": {
                "designFile": "{{'demos/cards/'+$['designs']._.name}}"
            }
        }
     }
}