
Command: setPrintArea
=====================

This is an equivalent of the [setPrintAreas](https://customerscanvas.com/docs/cc/customerscanvas.iframeapi.objectmodel.surface.setprintareas.htm) method from IFrame API, but only for one surface (either a specified surface or the current surface). 

Unlike [**changeLayout** command](change-layout.md), the design is loaded completely, including the background. 

## Params

- `data` - the same print area definition as used in the [setPrintAreas](https://customerscanvas.com/docs/cc/customerscanvas.iframeapi.objectmodel.surface.setprintareas.htm).
- `surfaceIndex` - which surface to replace. If omitted, the currently visible surface is modified.
- `options` - history management options. See the [setPrintAreas](https://customerscanvas.com/docs/cc/customerscanvas.iframeapi.objectmodel.surface.setprintareas.htm) docs for more details.

## Example

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