analyzeQualityOfDocument static method

Future<DocumentQualityResult> analyzeQualityOfDocument(
  1. Page page,
  2. {Size? analyzerImageSizeLimit}
)

Analyze a document and calculate its text quality page the page to analyze analyzerImageSizeLimit the maximum size of the document image to run detection on. If the image is larger than the specified size it will be downscaled.

Implementation

static Future<DocumentQualityResult> analyzeQualityOfDocument(Page page,
    {Size? analyzerImageSizeLimit}) async {
  try {
    var arguments = {'page': page.toJson()};
    analyzerImageSizeLimit
        ?.let((self) => arguments["analyzerImageSizeLimit"] = self.toJson());
    final value =
        await _channel.invokeMethod('analyzeQualityOfDocument', arguments);
    return DocumentQualityResult.fromJson(jsonDecode(value));
  } catch (e) {
    Logger.root.severe(e);
    rethrow;
  }
}