getScannedDocumentAsPdf method

  1. @override
Future getScannedDocumentAsPdf(
  1. int page
)
override

Scans documents and returns raw PDF data from the platform.

Returns null if the user cancelled.

Implementation

@override
Future<dynamic> getScannedDocumentAsPdf(int page) async {
  try {
    return await methodChannel.invokeMethod<dynamic>(
      'getScannedDocumentAsPdf',
      {'page': page},
    );
  } on PlatformException catch (e) {
    throw DocScanException(
      code: e.code,
      message: e.message ?? 'Failed to scan document as PDF',
      details: e.details,
    );
  }
}