Skip to content

Commit 2cad704

Browse files
authored
Merge pull request #983 from dynamsoft-docs/core-concepts
Core concepts
2 parents 0833d6a + 753c226 commit 2cad704

13 files changed

Lines changed: 323 additions & 0 deletions
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
layout: default-layout
3+
needAutoGenerateSidebar: true
4+
needGenerateH3Content: true
5+
noTitleIndex: true
6+
title: Dynamic Web TWAIN Core Concepts - Dynamic Web TWAIN Service
7+
keywords: Dynamic Web TWAIN, Documentation, Plugin, Service, Concept
8+
breadcrumbText: TWAIN
9+
description: This page gives a general introduction to Dynamic Web TWAIN Service, which makes it possible to access imaging devices in the browser.
10+
---
11+
12+
# Dynamic Web TWAIN Service
13+
14+
Dynamic Web TWAIN Service (previously known as Dynamsoft Service prior to version 19) is a local service installed on end-user devices to make it possible to access imaging devices in the browser. It also provides other functions like image processing, caching, barcode reading, OCR and system function calls.
15+
16+
![architecture](/assets/imgs/core-concepts//local-scan-architecture.svg)
17+
18+
To use Dynamic Web TWAIN in the browser, you have to install the service beforehand.
19+
20+
## Other Ways of Accessing Scanners in the Browser
21+
22+
Previously, technologies like ActiveX for Internet Explorer and NPAPI plugins for older versions of Chrome allowed scanner access directly in the browser. However, these technologies are now deprecated. Modern browsers lack built-in APIs for document scanning. While Chrome offers an experimental WebUSB API, it has limited functionality. Therefore, using a local service is currently the most viable solution.
23+
24+
## Related Articles
25+
26+
* [Setting up Dynamic Web TWAIN Service](/_articles/extended-usage/dynamsoft-service-configuration.md)
27+
* [FAQs Related to Dynamic Web TWAIN Service](/_articles/faq/index.md#project-deployment-and-end-user-installation)
28+
* [End-User Guide](/_articles/end-user/index.md)
29+
30+

_articles/core-concepts/TWAIN.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
layout: default-layout
3+
needAutoGenerateSidebar: true
4+
needGenerateH3Content: true
5+
noTitleIndex: true
6+
title: Dynamic Web TWAIN Core Concepts - TWAIN
7+
keywords: Dynamic Web TWAIN, Documentation, TWAIN, Concept
8+
breadcrumbText: TWAIN
9+
description: This page gives a general introduction to TWAIN, the document scanning API that Dynamic Web TWAIN exposes to the browser environment.
10+
---
11+
12+
# TWAIN
13+
14+
TWAIN is a standard for interacting with image devices, like document scanners and cameras. It was created by a small group of software and hardware companies in response to the need for a proposed specification for the imaging industry. Without TWAIN, we have to program for every device. With TWAIN, we only need to create an application that knows TWAIN and it can have access to thousands of TWAIN-compatible devices.
15+
16+
## Architecture
17+
18+
The architecture of TWAIN consists of four layers:
19+
20+
* Application - Dynamic Web TWAIN executes at this layer.
21+
* Protocol - There is a Source Manager working between the application and the Sources.
22+
* Acquisition - The software elements written to control acquisitions are called Sources and reside
23+
primarily in this layer.
24+
* Device - This is the location of traditional low-level device drivers.
25+
26+
## Files
27+
28+
The following files are required to use TWAIN.
29+
30+
### Source Manager
31+
32+
The implementation of the Source Manager differs between the supported systems:
33+
34+
* On Windows
35+
* The Source Manager is a Dynamic Link Library (TWAINDSM.DLL or twain_32.dll for old TWAIN versions).
36+
* The Source Manager can manage simultaneous sessions between an application and many
37+
Sources.
38+
* On Macintosh: The Source Manager is a Mach-O framework (TWAIN.framework, TWAINDSM.framework).
39+
* On Linux
40+
* The Source Manager is a shared library (/usr/local/lib/libtwaindsm.so).
41+
* The Source Manager can manage simultaneous sessions between an application and many
42+
Sources.
43+
44+
Normally, the system has the libraries built-in. Dynamsoft have the DLLs included in its Windows installer by default.
45+
46+
### Source
47+
48+
The implementation of the Source is the same as the implementation of the Source Manager:
49+
50+
* On Windows: The Source is a Dynamic Link Library (DLL) with a .ds extension. You can find the files after installing the driver under "C:\Windows\twain_32" and "C:\Windows\twain_64".
51+
* On Macintosh: The Source is implemented as a bundle (preferably Mach-O) with a .ds extension.
52+
* On Linux: The Source is a shared library (.so) with a .ds extension.
53+
54+
## TWAIN Capabilities
55+
56+
One of TWAIN's benefits is it allows applications to easily interact with a variety of acquisition
57+
devices. This is done using TWAIN capabilities.
58+
59+
TWAIN capabilities are divided into three groups:
60+
61+
* **CAP_xxxx**: Capabilities whose names begin with CAP are capabilities that could apply to any
62+
general Source. Such capabilities include use of automatic document feeders, identification of
63+
the creator of the data, etc.
64+
* **ICAP_xxxx**: Capabilities whose names begin with ICAP are capabilities that apply to image
65+
devices. The "I" stands for image.
66+
* **ACAP_xxxx**: Capabilities whose names begin with ACAP are capabilities that apply to
67+
devices that support audio. The "A" stands for audio.
68+
69+
Here are some capabilities for example:
70+
71+
* **CAP_DEVICEONLINE**: If TRUE, the physical hardware (e.g., scanner, digital camera, image database, etc.) that represents the image source is attached, powered on, and communicating.
72+
* **CAP_FEEDERENABLED**: If TRUE, Source must acquire data from the document feeder acquire area and other feeder capabilities can be used.
73+
* **ICAP_AUTOMATICBORDERDETECTION**: Turns automatic border detection on and off.
74+
75+
You can use this online demo to get and set the capabilities with Dynamic Web TWAIN: <https://demo.dynamsoft.com/web-twain/capabilities>.
76+
77+
You can learn more about TWAIN by reading its specifications: <https://github.com/twain/twain-specification>.
78+
79+
## Other Document Scanning APIs
80+
81+
Through time, Dynamic Web TWAIN added support for other APIs as well: WIA, SANE, ICA and eSCL. They can be used with the same set of JavaScript APIs.
82+
83+
Here is a table of the APIs and platforms Dynamic Web TWAIN supports.
84+
85+
86+
| | Windows | macOS | Linux |
87+
|-----------|---------|-----|-------|
88+
| **TWAIN** | X | X | |
89+
| **WIA** | X | | |
90+
| **ICA** | | X | |
91+
| **SANE** | | | X |
92+
| **eSCL** | X | X | X |
93+
94+
95+
96+
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
layout: default-layout
3+
needAutoGenerateSidebar: true
4+
needGenerateH3Content: true
5+
noTitleIndex: true
6+
title: Dynamic Web TWAIN Core Concepts - Resource Files
7+
keywords: Dynamic Web TWAIN, Documentation, Resource Files, Concept
8+
breadcrumbText: TWAIN
9+
description: This page gives a general introduction to Dynamic Web TWAIN's resource files.
10+
---
11+
12+
# Resource Files
13+
14+
Resources files are the files your web application needs to use.
15+
16+
There are two formats of resources files.
17+
18+
Format 1 is for the traditional vanilla JavaScript development. You can find the files in the [SDK installer](https://www.dynamsoft.com/web-twain/downloads/) or official samples' zip files.
19+
20+
```
21+
Resources
22+
│ dynamsoft.webtwain.config.js
23+
│ dynamsoft.webtwain.initiate.js
24+
│ dynamsoft.webtwain.install.js
25+
│ Readme.txt
26+
27+
├─addon
28+
│ dynamsoft.upload.js
29+
│ dynamsoft.webtwain.addon.barcodereader.js
30+
│ dynamsoft.webtwain.addon.pdf.js
31+
│ dynamsoft.webtwain.addon.webcam.js
32+
33+
├─dist
34+
│ DynamicWebTWAINServiceSetup-arm64.deb
35+
│ DynamicWebTWAINServiceSetup.deb
36+
│ DynamicWebTWAINServiceSetup.msi
37+
│ DynamicWebTWAINServiceSetup.pkg
38+
│ DynamicWebTWAINServiceSetup.rpm
39+
│ LICENSE
40+
41+
└─src
42+
dynamsoft.lts.js
43+
dynamsoft.webtwain.css
44+
dynamsoft.webtwain.viewer.css
45+
dynamsoft.webtwain.viewer.js
46+
```
47+
48+
Format 2 is for usage with package managers and frameworks or CDN references. You can obtain the files via `npm install dwt`.
49+
50+
```
51+
dwt
52+
│ dwt-openapi.yaml
53+
│ legal.txt
54+
│ LICENSE.txt
55+
│ package.json
56+
│ README.md
57+
58+
└─dist
59+
│ dynamsoft.webtwain.min.js
60+
│ dynamsoft.webtwain.min.mjs
61+
62+
├─dist
63+
│ DynamicWebTWAINServiceSetup-arm64.deb
64+
│ DynamicWebTWAINServiceSetup.deb
65+
│ DynamicWebTWAINServiceSetup.msi
66+
│ DynamicWebTWAINServiceSetup.pkg
67+
│ DynamicWebTWAINServiceSetup.rpm
68+
│ LICENSE
69+
70+
├─src
71+
│ dynamsoft.lts.js
72+
│ dynamsoft.webtwain.css
73+
│ dynamsoft.webtwain.viewer.css
74+
│ dynamsoft.webtwain.viewer.js
75+
76+
└─types
77+
Addon.BarcodeReader.d.ts
78+
Addon.OCR.d.ts
79+
Addon.OCRKit.d.ts
80+
Addon.OCRPro.d.ts
81+
Addon.PDF.d.ts
82+
Addon.Webcam.d.ts
83+
Dynamsoft.d.ts
84+
Dynamsoft.Enum.d.ts
85+
Dynamsoft.FileUploader.d.ts
86+
index.d.ts
87+
RemoteScan.d.ts
88+
RemoteScan.Viewer.d.ts
89+
tsconfig.json
90+
tslint.json
91+
WebTwain.Acquire.d.ts
92+
WebTwain.Buffer.d.ts
93+
WebTwain.d.ts
94+
WebTwain.Edit.d.ts
95+
WebTwain.IO.d.ts
96+
WebTwain.Util.d.ts
97+
WebTwain.Viewer.d.ts
98+
```
99+
100+
For more detailed information on these files, please refer to the following articles:
101+
102+
* [Loading Library Resources](/_articles/general-usage/resource-loading.md)
103+
* [What are the Resources files? ](/_articles/faq/what-are-the-resources-files.md)
104+

_articles/core-concepts/scanner.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
layout: default-layout
3+
needAutoGenerateSidebar: true
4+
needGenerateH3Content: true
5+
noTitleIndex: true
6+
title: Dynamic Web TWAIN Core Concepts - Scanner
7+
keywords: Dynamic Web TWAIN, Documentation, Scanner, Concept
8+
breadcrumbText: Scanner
9+
description: This page gives a general introduction to document scanners, which Dynamic Web TWAIN interacts with.
10+
---
11+
12+
# Scanner
13+
14+
Scanners are the major object which Dynamic Web TWAIN interacts with. We are going to give a brief introduction to it, focusing on what matters to Dynamic Web TWAIN.
15+
16+
## Scanner Types
17+
18+
### Flatbed Scanner
19+
20+
A flatbed scanner is a type of scanner that provides a glass bed (platen) on which the object to be scanned lies motionless. The scanning element moves horizontally beneath the glass, capturing either the entirety of the platen or a predetermined portion.
21+
22+
![Epson v850](/assets/imgs/core-concepts/Epson_V850_scanner_open_20230920.jpg)
23+
24+
Most flatbed scanners work in a reflective way, which shines white light onto the object and reads the intensity and color of light reflected from it. Some flatbed scanners also have transparency adapters (for scanning films and slides). These work differently: the light passes directly through the scanned object. In the scanning application, you can select whether to use the transparent unit or not.
25+
26+
### Sheetfed Scanner
27+
28+
A sheetfed scanner, also known as a document feeder scanner or ADF (Automatic Document Feeder) scanner, uses motor-driven rollers to move individual sheets of paper past a stationary scanning element (or two for duplex scanning). Unlike flatbed scanners, sheetfed scanners are not designed to scan bound materials such as books or magazines, nor are they suitable for materials thicker than standard paper. Their primary advantage is the ability to scan multiple documents quickly and automatically, making them much faster than flatbed scanners for high-volume tasks.
29+
30+
![ScanSnap iX500](/assets/imgs/core-concepts/ScanSnap_iX500.jpg)
31+
32+
### All-in-One Scanner
33+
34+
All-in-one scanners, commonly found in Multi-Function Printers (MFPs), integrate both a document feeder and a flatbed, offering the versatility of both scanner types in a single device.
35+
36+
![Ricoh 5055](/assets/imgs/core-concepts/500px-Ricoh_5055_MFP.jpg)
37+
38+
### Camera-Based Scanner
39+
40+
Camera-based scanners use one or more digital cameras to capture a document image all at once, typically with an overhead design.
41+
42+
![CZUR ET Series](/assets/imgs/core-concepts/ET_Series_Book_Scanner.png)
43+
44+
Unlike traditional scanners that scan line-by-line in a controlled environment, camera-based scanners are faster and can handle various materials, including bound books and fragile documents. However, they may be susceptible to issues like perspective distortion, shadows, and inconsistent lighting.
45+
46+
## Special Scanners
47+
48+
There are also scanners designed for specific use cases.
49+
50+
### Check Scanners
51+
52+
Check scanners are equipped with a Magnetic Ink Character Recognition (MICR) unit, which reads the magnetic ink characters printed on checks.
53+
54+
![Epson TM-S1000](/assets/imgs/core-concepts/A41A266001_Scanners_Epson%20TM-S1000_PT.png)
55+
56+
With Dynamic Web TWAIN, you can not only retrieve the scanned image but also obtain the MICR data from the check.
57+
58+
### Scanners with Imprinter / Endorser
59+
60+
Many production scanners can be integrated with a printer or endorser module. This allows them to print text or barcodes directly onto the scanned documents during the scanning process, which is useful for document routing or post-scan sorting.
61+
62+
![fi-7160](/assets/imgs/core-concepts/FI-7160.2.jpg)
63+
64+
## Connectivity
65+
66+
Most modern scanners use USB for connection, while older models may use SCSI or a parallel port. Network connectivity (Wi-Fi or Ethernet) is also common, especially in office environments.
67+
68+
## Application Programming Interface
69+
70+
Standardized Application Programming Interfaces (APIs) enable software to communicate with scanners. The most common ones include:
71+
72+
* **TWAIN** – The industry standard API widely used by scanners, especially on Windows.
73+
* **WIA** (Windows Image Acquisition) – An API provided by Microsoft for image acquisition.
74+
* **SANE** (Scanner Access Now Easy) – A free/open-source API primarily used on Linux and macOS.
75+
* **ImageCaptureCore** – A native API provided by Apple for macOS and iOS.
76+
* **ISIS** (Image and Scanner Interface Specification) – A high-performance API often used with high-speed production scanners in enterprise environments.
77+
* **eSCL** – A vendor-neutral, RESTful-based protocol for driverless scanning over a network, commonly used by modern networked scanners and MFPs.

_articles/index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ description: Dynamic Web TWAIN SDK Documentation Homepage
1313
- [System Requirements]({{site.introduction}}system-requirements.html)
1414
- [Imaging Hardware]({{site.introduction}}imaging-hardware.html)
1515
- [Supported File Formats]({{site.introduction}}supported-file-formats.html)
16+
- Core Concepts
17+
- [Scanner](/_articles/core-concepts/scanner.md)
18+
- [TWAIN](/_articles/core-concepts/TWAIN.md)
19+
- [Dynamic Web TWAIN Service](/_articles/core-concepts/Dynamic-Web-TWAIN-Service.md)
20+
- [Resource Files](/_articles/core-concepts/resource-files.md)
1621

1722
## Developer Guide
1823

_data/full_tree.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ tree_list:
88
path: /introduction/imaging-hardware.html
99
- name: Supported File Formats
1010
path: /introduction/supported-file-formats.html
11+
- name: Core Concepts
12+
childList:
13+
- name: Scanner
14+
path: /core-concepts/scanner.html
15+
- name: TWAIN
16+
path: /core-concepts/TWAIN.html
17+
- name: Dynamic Web TWAIN Service
18+
path: /core-concepts/Dynamic-Web-TWAIN-Service.html
19+
- name: Resource Files
20+
path: /core-concepts/resource-files.html
1121

1222
- name: Developer Guide
1323
isCategory: true
32.1 KB
Loading
117 KB
Loading
51.3 KB
Loading
22.2 KB
Loading

0 commit comments

Comments
 (0)