flutter_document_scan_sdk 0.3.0 icon indicating copy to clipboard operation
flutter_document_scan_sdk: ^0.3.0 copied to clipboard

A Flutter wrapper for Dynamsoft Document Normalizer, providing API for document edge detection and document rectification.

flutter_document_scan_sdk #

The Flutter plugin is a wrapper for Dynamsoft's Document Normalizer SDK. It enables you to build document rectification applications for Windows, Linux, web, Android and iOS.

Try Document Rectification Example #

Desktop: Windows & Linux #

Windows

cd example
flutter run -d windows

Flutter windows document edge detection and normalization

Linux

cd example
flutter run -d linux

Flutter Linux document edge detection and normalization

Web #

cd example
flutter run -d chrome

Flutter web document edge detection and normalization

Mobile: Android & iOS #

cd example
flutter run 

Flutter document rectification for Android and iOS

Getting a License Key for Dynamsoft Document Normalizer #

Supported Platforms #

  • Web
  • Windows
  • Linux
  • Android
  • iOS

Installation #

Add flutter_document_scan_sdk as a dependency in your pubspec.yaml file.

dependencies:
    ...
    flutter_document_scan_sdk:

One More Step for Web #

Include the JavaScript library of Dynamsoft Document Normalizer in your index.html file:

<script src="https://cdn.jsdelivr.net/npm/dynamsoft-document-normalizer@1.0.11/dist/ddn.js"></script>

API Compatibility #

MethodsAndroidiOSWindowsLinuxmacOSWeb
Future<int?> init(String path, String key)✔️✔️✔️✔️✔️✔️
Future<List<DocumentResult>?> detect(String file)✔️✔️✔️✔️✔️✔️
Future<NormalizedImage?> normalize(String file, dynamic points)✔️✔️✔️✔️✔️✔️
Future<int?> save(String filename)✔️✔️✔️✔️✔️✔️
Future<int?> setParameters(String params)✔️✔️✔️✔️✔️✔️
Future<String?> getParameters()✔️✔️✔️✔️✔️✔️

Usage #

  • Initialize the document rectification SDK with resource path and license key. The resource path is only required for web apps:

      final _flutterDocumentScanSdkPlugin = FlutterDocumentScanSdk();
      await _flutterDocumentScanSdkPlugin.init(
          "https://cdn.jsdelivr.net/npm/dynamsoft-document-normalizer@1.0.11/dist/",
          "DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAxLTE2NDk4Mjk3OTI2MzUiLCJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSIsInNlc3Npb25QYXNzd29yZCI6IndTcGR6Vm05WDJrcEQ5YUoifQ==");
    
      await _flutterDocumentScanSdkPlugin.setParameters(Template.grayscale);
    
  • Do document edge detection and return quadrilaterals:

      List<DocumentResult>? detectionResults =
              await _flutterDocumentScanSdkPlugin
                  .detect(file);
    
  • Rectify the document based on document corners:

      NormalizedImage? normalizedImage = await _flutterDocumentScanSdkPlugin.normalize(
          file, detectionResults[0].points);
    
  • Save the document to the local disk:

      await _flutterDocumentScanSdkPlugin
                                  .save('normalized.png');
    
2
likes
140
pub points
53%
popularity

Publisher

verified publisher iconyushulx.me

A Flutter wrapper for Dynamsoft Document Normalizer, providing API for document edge detection and document rectification.

Homepage
Repository (GitHub)

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

flutter, flutter_web_plugins, js, plugin_platform_interface

More

Packages that depend on flutter_document_scan_sdk