TWTwainJS consists of two main parts:
1
TWTwainJS
Javascript
TWTwainJS connects to TWTwainClient by opening a socket connection from your website where you want to provide scanning functionality.
Requirement:
1. Install TWTwainClient on your Windows OS machine.
2. Visit the web page where TWTwainJS is implemented
Extract TWTwainJS.zip
Let's presume that you have index.html and index.js and you plan to support modern browsers which support ES2015
In index.js
This simple example will try to open a socket connection with the TWTwainClient.
Once opened, it will scan on the local default device in the jpeg format. The scanner's settings dialog will be shown.
On every page scanned, TWEvent.PAGE_SCANNED is triggered with the scanned image in its detail.
For more examples of advanced use (like settings TWAIN capabilities, saving in different formats like PDF or TIFF, and downloading scanned results...), please visit the link provided via the button below.
To avoid a watermark on your scanned pages, you need a valid license key, which you will retrieve upon purchasing the product.
The license key is set on the TWTwainJS side using the following syntax:
The license is based on the allowed domain names, which are set by the license owner during the purchase process.
The license allows usage on one domain and up to three subdomains, and it will only work on the domain names that have been explicitly allowed by the license owner.
For example, if your website is on the domain www.yourdomain.com and you set that as an allowed domain, the license will only work if the software is run on www.yourdomain.com or one of its allowed subdomains.
In addition to the licensing benefits, you will receive one year of free upgrades and support provided directly by our developers.
A fully functional demo with a watermark is available on the link provided via the button below.
The source code of that demo is available in the TWTwainJS.zip file.
It is written in plain JS, so it can be used in static sites, PHP, Django, and ASP.NET Core. It is web technology agnostic.
In TWTwainJS.zip is provided the ES6 Javascript version, which will work in modern browsers, and the ES5 version for older browsers.
TWTwainJS uses window, CustomEvent, and WebSocket object so:
A fully functional demo with a watermark is available on the link provided via the button below.
Once installed, TWTwainClient has the option to set its settings.
Once started, you will see these settings options.
If you have additional questions, don't hesitate to contact us through the form below or at [email protected]