flutter_web_twain 0.0.1 copy "flutter_web_twain: ^0.0.1" to clipboard
flutter_web_twain: ^0.0.1 copied to clipboard

discontinuedreplaced by: flutter_twain_scanner
Platformweb

A Flutter wrapper for Dynamic Web TWAIN. It provides basic methods for document scan, load and save.

flutter_web_twain #

The Flutter plugin is a wrapper for Dynamsoft's Web TWAIN SDK. It allows you to build web document scanning applications with Flutter.

Getting a License Key for Dynamic Web TWAIN #

Installation #

  1. Add flutter_web_twain as a dependency in your pubspec.yaml file.

  2. In the root of your project, download the Dynamic Web TWAIN npm package:

    npm install dwt
    
  3. Include the following line in your index.html file:

    <script src="node_modules/dwt/dist/dynamsoft.webtwain.min.js"></script>
    

Usage #

  • Initialize the Flutter Web TWAIN SDK:

    final FlutterWebTwain _flutterWebTwain = FlutterWebTwain();
    WebTwainController _controller = await _flutterWebTwain.createWebTwainController();
    await _controller!.init('node_modules/dwt/dist/',
           'LICENSE-KEY');
    
  • Embed the image container into your widget tree:

    Expanded(
        child: _controller == null
            ? const CircularProgressIndicator()
            : HtmlElementView(viewType: _controller!.webviewId),
    ),
    
  • Acquire documents from a document scanner:

    await _controller!.scan(
        '{"IfShowUI": false, "PixelType": ${_pixelFormat!.index}}');
    
  • Load images from the local file system:

    await _controller!.load();
    
  • Save single or multiple images as PDF, TIFF or JPEG:

    await _controller!.download(FileFormat.PDF.index, 'filename');
    

Try the Example #

cd example
flutter run -d chrome

Flutter web document scanning SDK

4
likes
120
pub points
0%
popularity

Publisher

verified publisheryushulx.me

A Flutter wrapper for Dynamic Web TWAIN. It provides basic methods for document scan, load and save.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_web_plugins, js, plugin_platform_interface

More

Packages that depend on flutter_web_twain