# detectDocument static method

1. @Deprecated('Use ScanbotSdk.document.detectDocument instead.')

Future<Page> detectDocument(

1. Page page

)

Performs automatic document detection on the original image of the given `page`.

Returns the Page with detected polygon information.

Deprecated: Use `ScanbotSdk.document.detectDocument` instead.

## Implementation

    @Deprecated('Use ScanbotSdk.document.detectDocument instead.')
    static Future<Page> detectDocument(Page page) async {
      try {
        var arguments = {'page': page.toJson()};
        var documentScanningResult =
            await channel.invokeMethod('detectDocument', arguments);
        var json = jsonDecode(documentScanningResult);
        var pageResult = Page.fromJson(json);
        return pageResult;
      } catch (e) {
        Logger.root.severe(e);
        rethrow;
      }
    }