What You Should Know About Dynamic Web TWAIN v16.0
Dynamsoft will release a new version of the document scanning SDK, Dynamic Web TWAIN, at the end of next month. This version extends the existing functionalities of its desktop version to the mobile platforms. Also, Dynamsoft has developed a brand new image viewer to deliver a unified document capture and management experience across Windows, Linux, macOS, Android, and iOS.
This version allows mobile users to easily capture, edit and save documents. During this unusual time, people are staying home to work and may be without access to their office computers and scanners. Carrying on with the usual workflow via their mobile phones is essential to ensure efficiency and connectivity. Keep reading to find more details about the improvements.
New Cross-Platform Viewer
The revamped viewer’s cross-platform capability extends to the mobile browsers including Chrome 76+, Firefox 68+ on Android, and Safari 13.1+, Chrome 76+ on iOS. The extended set of APIs brought over from the desktop version allows mobile users to load, edit, save, upload files and capture images from the camera right in the mobile browsers. It is now easier than ever for application developers to satisfy the increasing need to be mobile-friendly and as well as providing a seamless transition between desktop and mobile devices.
Compiled New WASM Modules
The Dynamic Web TWAIN core modules were originally developed in C++ during the desktop workstation era. In order to accommodate the newly emerged mobile world, all the core modules have been compiled into their respective WASM counterparts.
Also, the expansion to support mobile browsers viewing also required our image encoding methods to adapt. Images that are sent to the viewer are JPG format by default unless:
- The Original Image is requested, then PNG is used; or
- If the image cannot be loaded as a JPG, such as a B&W image
JPG format can be easily processed in WASM programming and it’s much faster than the other formats.
Capability Negotiation with JSON
Some scanners have hundreds of settings and advanced capabilities to use, Dynamic Web TWAIN 16.0 is bringing a faster and more convenient way to negotiate these capabilities with the scanner.
Create A Viewless DWT Object
In a single-page application based on frameworks and libraries like Angular, Vue, and React, you might want to load the TWAIN control first and create the viewer component later on when you need it. Now with v16.0, you can achieve this.
- First, create a viewless DWT Object
- Bind a view to a DWT object where one DWT Object only allows one viewer to be bound
- Optionally use UpdateView(config) to update the viewer settings
- Optionally use UnbindView() to unbind and bind to a new viewer
Use Dynamic Web TWAIN Without Installing the Dynamsoft Service
Users would need to install the Dynamsoft service to enable scanner controls. This module accepts user operation commands from a JavaScript client. It listens on localhost and handles the interface with TWAIN and passes the response to the JavaScript layer.
In the new version 16.0, a global API Dynamsoft.WebTwainEnv.UseLocalService is available for the desktop to control whether this service would be installed or not for the user. If not installed, users can still load images, edit, save locally or upload to the server, they can even turn on the webcam to capture images. However, to acquire images from scanner devices, the Dynamsoft Service needs to be installed by leaving Dynamsoft.WebTwainEnv.UseLocalService to the default TRUE.
Other Improvements
- All methods can now be called asynchronously to fix a warning message that appears in the console when initializing the module. Although some can still be called synchronously, it’s discouraged as it may negatively affect the end user’s experience.
- All properties are now cached in JS until it’s necessary to connect to the service, this change results in fewer HTTP requests and faster response.
- Add EnableSourceUI to open the DataSource UI and set things up without initiating a scan. And the settings can be saved for use next time without opening the UI again.
- During loading, images in TIFFs & PDFs are decoded in JPGs if they are encoded this way originally, otherwise, they are encoded as PNGs. This modification fixes the issue of an occasional discrepancy between the original and the output files in some cases.
Originally published at https://blog.dynamsoft.com on April 13, 2020.