# startDocumentScanner static method

Future<DocumentScanningResult> startDocumentScanner(

1. DocumentScannerConfiguration config

)

Starts the Ready-to-Use Document Scanner UI as full-screen modal UI dialog. The Document Scanner provides guided, automatic document scanning.

## Implementation

    static Future<DocumentScanningResult> startDocumentScanner(
        DocumentScannerConfiguration config) async {
      try {
        var updatedParameters = config.toJson();
        const defaultJsonName = "DocumentScreen";
        var configuration = await SharedCalls.applyParametersOnDefaultJson(
            defaultJsonName, updatedParameters);
        var docSize = configuration['documentImageSizeLimit'];
        if (docSize['width'] == 0 || docSize['height'] == 0) {
          configuration.remove('documentImageSizeLimit');
        }

        var result = await SharedCalls.invoke(
            _channel, 'startDocumentScanner', configuration);
        if (SharedCalls.wasCanceled(result)) {
          return DocumentScanningResult.canceled();
        }
        return DocumentScanningResult.fromJson(jsonDecode(result));
      } catch (e) {
        Logger.root.severe(e);
        return DocumentScanningResult.error(e.toString());
      }
    }