# getDecryptedDataFromFile static method

Future<Uint8List> getDecryptedDataFromFile(

1. Uri fileUri

)

Get decrypted file byte data using encryption parameters that were set up during SDK initialization. In case encryption parameters were not set, it returns just the file's byte data as it is. The main purpose of this class is to work with preview images. It is still possible to use it for any file that was encrypted by ScanbotSDK (PDF, TIFF, etc).

Due to internal Flutter logic, the data is copied during the transition from the native part. That multiplies resource consumption and can create heavy load on the system, in case of decrypting large files. So while it is possible to use it with any file, you are responsible for preventing system overload while decrypting large files.

## Implementation

    static Future<Uint8List> getDecryptedDataFromFile(Uri fileUri) async {
      try {
        var imageDataResult = await _channel
            .invokeMethod('getDecryptedDataFromFile', {'fileUri': fileUri.path});
        return imageDataResult;
      } catch (e) {
        Logger.root.severe(e);
        rethrow;
      }
    }