createPageWithImageBytes static method

Future<Page> createPageWithImageBytes(
  1. Uint8List imageBytes,
  2. bool shouldDetectDocument
)

Creates a page from image bytes. The given image will be used as ORIGINAL image. Use the shouldDetectDocument flag to specify whether the auto-document detection should be performed and the (cropped) DOCUMENT image should be created. return Page

Implementation

static Future<Page> createPageWithImageBytes(
    Uint8List imageBytes, bool shouldDetectDocument) async {
  try {
    var arguments = {
      'originalImageBytes': imageBytes,
      'shouldDetectDocument': shouldDetectDocument
    };
    final pageJson =
        await _channel.invokeMethod('createPageWithImageBytes', arguments);
    var decoded = jsonDecode(pageJson);
    return Page.fromJson(decoded);
  } catch (e) {
    Logger.root.severe(e);
    rethrow;
  }
}