
# 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 [ICanvasDefinitionSetBackground](../interfaces/icanvasdefinitionsetbackground.md).
```
{
  "type": "canvas",
  "name": "editor",
  "params": {
    "initial": { ... },
    "setBackground": {
      "url": "public:bg_123.pdf"
    }
  }
}
```

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

## Hierarchy

* [CanvasWidgetCommand](canvaswidgetcommand.md)

* [DesignEditorWidgetCommand](designeditorwidgetcommand.md)

  ↳ **SetBackgroundCommand**

## Index

### Methods

* [execute](setbackgroundcommand.md#execute)

## Methods

###  execute

▸ **execute**(`params`: [ICanvasDefinitionSetBackground](../interfaces/icanvasdefinitionsetbackground.md)): *Promise‹unknown›*

*Overrides [CanvasWidgetCommand](canvaswidgetcommand.md).[execute](canvaswidgetcommand.md#abstract-execute)*

Executes this command.

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`params` | [ICanvasDefinitionSetBackground](../interfaces/icanvasdefinitionsetbackground.md) | Parameters for the command, an object or an array of objects.  |

**Returns:** *Promise‹unknown›*
