# Interface: MWCScanner

[Mobile Web Capture API Reference](../index.md) / MWCScanner

# Interface: MWCScanner

The contract a scanner must satisfy to be plugged into Mobile Web Capture.

## Remarks

MWC scans with Mobile Document Scanner by default. Assign [MobileWebCaptureConfig.scanner](MobileWebCaptureConfig.md#scanner) to substitute any other scanner — an MRZ scanner, a barcode-driven capture step, or your own camera UI — as long as it implements this interface.

`launch` must resolve with a result carrying `imageData: true` (note: *not* `_imageData`) and an `_imageData` object exposing `toBlob()`, which is how MWC gets the captured image.

## Example

```typescript
const mobileWebCapture = new Dynamsoft.MobileWebCapture({
    license: "YOUR_LICENSE_KEY_HERE",
    scanner: myCustomScanner,
});
```

## Methods

### dispose()

> **dispose**(): `void`

Releases the scanner's resources.

#### Returns

`void`

#### Remarks

Called by `MobileWebCapture.dispose`.

***

### initialize()

> **initialize**(): `Promise`\<`any`\>

Initializes the scanner's resources.

#### Returns

`Promise`\<`any`\>

#### Remarks

Called once by MWC before the scanner is first launched.

***

### launch()

> **launch**(): `Promise`\<`any`\>

Runs one scan and resolves with its result.

#### Returns

`Promise`\<`any`\>

A result object with `imageData: true` and an `_imageData` object whose `toBlob()` yields the captured image. A `status.code` of `EnumResultStatus.RS_SUCCESS` marks a completed scan.
