18.4.2 • Published 5 months ago

dwt v18.4.2

Weekly downloads
4,710
License
SEE LICENSE IN LI...
Repository
github
Last release
5 months ago

Dynamic Web TWAIN SDK for Scanner and Camera

version downloads jsdelivr npm.io

Dynamic Web TWAIN is a cross-platform scanning SDK designed for web document management applications. With just a few lines of JavaScript code, you can develop robust web applications to scan documents, edit images and save them to file systems. To see it in action, please visit this online demo

Note: Dynamic Web TWAIN SDK v17.3 is built in this package. For more detail, check the Version Info.

Table of Contents

Supported Environments

Supported Image Capturing Devices

  • Physical Document Scanners
  • Desktop Webcam
  • Mobile Camera

Supported Web Browsers

  • Chrome
  • Firefox
  • Edge
  • Safari

Supported OSs

  • Windows
  • Linux
  • macOS
  • Android / iOS (Remote scanner or camera)

Supported CPU Architectures

  • x86/x64
  • MIPS64
  • ARM64

License Key

npm.io

Installation

  • Official web site

    Dynamic Web TWAIN SDK for Windows, Linux, macOS

    npm.io

  • NPM

    npm install dwt@17.3.5

A Virtual Scanner

If you do not have a physical scanner to test on Windows, you can install a virtual scanner.

Read more here.

Deployment

Dynamic Web TWAIN relies on the files in the /dist/ folder to work. Make sure to put these files on your server and correctly refer to them by specifying the path with ResourcesPath (relative and absolute paths are both fine).

If you are making use of the CDN jsDelivr, you will still need to host the /dist/ folder somewhere on your server and refer to it by specifying the path with ResourcesPath. This is because file types like .msi are not allowed by this CDN.

Quick Start

Step 1 Create a HTML page and load dynamsoft.webtwain.min.js into your page:

<!DOCTYPE html>
<html>
<head>
	<title>Hello World</title>
	<script src="dist/dynamsoft.webtwain.min.js"></script>
</head>
<body>
</body>
</html>

Note that a relative path is used. You might want to change it based on where you are putting your code. The best practise is to put all the files on your own server and under the same domain as your web application.

Step 2 Add a script tag and make initial settings:

<!DOCTYPE html>
<html>
<head>
	<title>Hello World</title>
	<script src="dist/dynamsoft.webtwain.min.js"></script>
</head>
<body>
	<script type="text/javascript">
	  Dynamsoft.DWT.ResourcesPath = "dist";
	  Dynamsoft.DWT.ProductKey = 't0140cQMAA...';
   Dynamsoft.DWT.Containers = [{ ContainerId: 'dwtcontrolContainer', Width: 270, Height: 350 }];
	</script>
</body>
</html>

Note that ResourcesPath must be set in order to use the library.

  1. ResourcesPath is a relative path to where you put the directory "/dist/" and all the files in it.
  2. If you don't have a valid ProductKey, you can request a trial key to use.

Step 3 Write code to use the package to do a simple document scan

The following code demonstrates the minimum code needed to use the package. Note the addition of HTML elements as well as JavaScript code. For more sophisticated sample or demo, check out the Sample Gallery and our Github Repositories.

<!DOCTYPE html>
<html>
<head>
	<title>Hello World</title>
	<script src="dist/dynamsoft.webtwain.min.js"></script>
</head>
<body>
	<input type="button" value="Scan" onclick="AcquireImage();" />
	<div id="dwtcontrolContainer"></div>
	<script type="text/javascript">
	  Dynamsoft.DWT.ResourcesPath = "dist";
	  Dynamsoft.DWT.ProductKey = 't0140cQMAA...'; // Put your own key here
   Dynamsoft.DWT.Containers = [{ ContainerId: 'dwtcontrolContainer', Width: 270, Height: 350 }];
	  window.onload = function () {
	    Dynamsoft.DWT.Load();
	  };
	  var DWObject;
	  function Dynamsoft_OnReady() {
	    // dwtcontrolContainer is the id of the DIV to create the WebTwain instance in.
	    DWObject = Dynamsoft.DWT.GetWebTwain('dwtcontrolContainer');
	  }
	  function AcquireImage() {
	    if (DWObject) {
	      DWObject.SelectSource(function () {
	        DWObject.OpenSource();
	        DWObject.AcquireImage(
	          {
	            PixelType: Dynamsoft.EnumDWT_PixelType.TWPT_RGB,
	            Resolution: 200,
	            IfDisableSourceAfterAcquire: true
	          },
	          function () {
	            console.log("Successful!");
	          },
	          function (settings, errCode, errString) {
	            alert(errString)
	          }
	        );
	      }, function () {
	        alert('SelectSource failed!');
	      });
	    }
	  }
	</script>
</body>
</html>

Documentation

Features

Dynamsoft Service for Scanner

FeaturesWindowsLinuxmacOS
Supports up to TWAIN specification 2.3:heavy_check_mark::x::x:
SANE compatible:x::heavy_check_mark::x:
Supports up to TWAIN specification 1.9; ICA compatible:x::x::heavy_check_mark:
Supports capturing document:heavy_check_mark::heavy_check_mark::heavy_check_mark:
Supports editing document:heavy_check_mark::heavy_check_mark::heavy_check_mark:
Optional disk caching mechanism for high volume scanning (thousands of pages):heavy_check_mark::heavy_check_mark::heavy_check_mark:
Built-In Auto Document Feeder (ADF) and multiple image acquisition:heavy_check_mark::heavy_check_mark::heavy_check_mark:
Offers duplex scanning mode:heavy_check_mark::heavy_check_mark::heavy_check_mark:
Supports blank page detection:heavy_check_mark::heavy_check_mark::heavy_check_mark:
Supports setting up image acquisition parameters (resolution, pixel type, bit depth, brightness, contrast, page size, unit, etc.):heavy_check_mark::heavy_check_mark::heavy_check_mark:
Provides native and disk file image transfer modes:heavy_check_mark::heavy_check_mark::heavy_check_mark:
Buffered memory transfer mode:heavy_check_mark::x::x:

More

WebAssembly for Camera

FeaturesDesktopMobile
Document capture:heavy_check_mark::heavy_check_mark:
Document edge detection:heavy_check_mark::heavy_check_mark:
Document perspective correction:heavy_check_mark::heavy_check_mark:
Document post-processing by filters:heavy_check_mark::heavy_check_mark:
Front and rear camera switching:heavy_check_mark::heavy_check_mark:
Dedicated image and PDF viewer:heavy_check_mark::heavy_check_mark:
Built-in ready-to-use UI:heavy_check_mark::heavy_check_mark:
SIMD and WebGL acceleration:heavy_check_mark::heavy_check_mark:
Multi-Format export and sharing:heavy_check_mark::heavy_check_mark:

More

Contact Us

Contact Dynamsoft to resolve any issue you encounter with the library.

License Agreement

https://www.dynamsoft.com/Products/WebTWAIN_License.aspx

Versions

Dynamsoft Service (DynamsoftService.exe, 64bit)

v17.3.5 (build version 1, 7, 3, 1212)

Dynamsoft Service Manager (DWASManager_17351212.dll, 64bit)

v17.3.5 (build version 17, 3, 5, 1212)

Dynamic Web TWAIN (dwt_17.3.5.1212.dll, 64bit)

v17.3.5 (build version 17, 3, 5, 1212)

Dynamsoft PDF Rasterizer (DynamicPdfRx64_11.4.0.0531.dll, 64bit)

v17.3 (build version 11, 4, 0, 0531)

Dynamsoft OCR Basic Engine (DynamicOCRx64_10.0.0.0618.dll, 64bit)

v17.3 (build version 10, 0, 0, 0618)

Dynamsoft Barcode Reader (dbrx64_8.8.0.0531.dll, 64bit)

v8.8.0 (build version 8, 8, 0, 0531)

Dynamsoft Webcam Addon (DynamicWebcamx64_15.0.0.0625.dll, 64bit)

v17.3 (build version 15, 0, 0, 0625)

Dynamsoft Upload Module (UploadModule_1.7.2.1026.dll, 64bit)

v17.3 (build version 1, 7, 2, 1026)

Changelog

Check out the release notes of the Dynamic Web TWAIN library.

Note

If you are upgrading from the old versions to V17.1+, please add the following code after Dynamsoft.DWT.ProductKey to make Dynamsoft.DWT.Load take effect.

Dynamsoft.DWT.Containers = { ContainerId: 'dwtcontrolContainer', Width: 270, Height: 350 };

Otherwise, the initialization will fail.

17.3.5

5 months ago

16.2.6

5 months ago

18.4.2

5 months ago

18.4.1

6 months ago

18.4.0

7 months ago

17.3.4

10 months ago

18.1.3-beta

9 months ago

18.0.2

10 months ago

18.3.0

10 months ago

18.2.1

11 months ago

18.2.0

12 months ago

17.3.3

12 months ago

18.1.2-beta

1 year ago

17.3.2

1 year ago

18.1.1

1 year ago

18.1.0

1 year ago

18.0.0

1 year ago

17.3.1

2 years ago

17.3.0

2 years ago

17.2.5

2 years ago

17.2.3

2 years ago

17.2.2

2 years ago

17.2.4

2 years ago

17.2.1

2 years ago

17.2.0

2 years ago

16.1.7

3 years ago

17.1.12

3 years ago

16.1.6

3 years ago

16.1.5

3 years ago

17.1.11

3 years ago

17.1.10

3 years ago

17.1.9

3 years ago

17.1.8

3 years ago

17.1.7

3 years ago

17.1.6

3 years ago

17.1.5

3 years ago

17.1.4

3 years ago

17.1.3

3 years ago

16.2.5

3 years ago

17.1.2

3 years ago

17.1.1

3 years ago

17.1.0

3 years ago

17.0.2

3 years ago

17.0.1

3 years ago

17.0.0

3 years ago

16.2.4

3 years ago

16.2.3

3 years ago

16.2.2

3 years ago

16.2.1

3 years ago

16.2.0

3 years ago

16.1.4

3 years ago

16.1.3

3 years ago

16.1.2

4 years ago

16.1.1

4 years ago

16.1.1-test

4 years ago

16.1.0

4 years ago

16.0.0

4 years ago

16.0.0-test

4 years ago

16.0.0-rc

4 years ago

15.3.3-sdk

4 years ago

15.3.2-sdk

4 years ago

15.3.2

4 years ago

15.3.1

4 years ago

15.3.0

4 years ago

15.2.0

5 years ago

15.1.1

5 years ago

15.1.0

5 years ago

15.0.3

5 years ago

15.0.2

5 years ago

15.0.1

5 years ago

15.0.0

5 years ago

14.3.2

5 years ago

14.3.1

5 years ago

14.3.0

5 years ago

14.2.0

6 years ago

14.1.0

6 years ago

14.0.3

6 years ago

14.0.2

6 years ago

14.0.1

6 years ago

14.0.0

6 years ago

13.4.6

6 years ago

13.4.5

6 years ago

13.4.4

6 years ago

13.4.3

6 years ago

13.4.2-beta

6 years ago

13.4.2-alpha.1

6 years ago

13.4.1

6 years ago

13.4.0

6 years ago

13.3.1

6 years ago

13.3.0

6 years ago

13.2.0

6 years ago

13.1.0

7 years ago

13.0.0

7 years ago

12.3.0

7 years ago

12.2.1

7 years ago

12.2.0

7 years ago

12.1.0

7 years ago

11.3.4

8 years ago

11.3.3

8 years ago

11.3.2

8 years ago

11.3.0

8 years ago