
# Class: SetBackgroundCommand

A command that replaces the background image in the editor.
A command that replaces the background image in the editor.

For details, you can refer to the [IDesignEditorDefinitionSetBackground](../interfaces/idesigneditordefinitionsetbackground.md).
```
{
  "type": "design-editor",
  "name": "editor",
  "params": {
    "initial": { ... },
    "setBackground": {
      "url": "public:bg_123.pdf"
    }
  }
}
```

For details, you can refer to the [ICanvasDefinitionSetBackground](../interfaces/icanvasdefinitionsetbackground.md).
```
{
  "type": "canvas",
  "name": "editor",
  "params": {
    "initial": { ... },
    "setBackground": {
      "url": "public:bg_123.pdf"
    }
  }
}
```

## Hierarchy

* [DesignEditorWidgetCommand](designeditorwidgetcommand.md)

* [CanvasWidgetCommand](canvaswidgetcommand.md)

  ↳ **SetBackgroundCommand**

## Index

### Methods

* [execute](setbackgroundcommand.md#execute)

## Methods

###  execute

▸ **execute**(`data`: [ISetBackgroundParam](../interfaces/isetbackgroundparam.md) | [ISetBackgroundParam](../interfaces/isetbackgroundparam.md)[]): *Promise‹void›*

*Overrides [DesignEditorWidgetCommand](designeditorwidgetcommand.md).[execute](designeditorwidgetcommand.md#abstract-execute)*

Executes this command.

**Parameters:**

Name | Type |
------ | ------ |
`data` | [ISetBackgroundParam](../interfaces/isetbackgroundparam.md) &#124; [ISetBackgroundParam](../interfaces/isetbackgroundparam.md)[] |

**Returns:** *Promise‹void›*
