Dynamsoft Blog

The leading provider of version control solutions and TWAIN SDKs

How We Helped VALID USA Deliver WebLink ID App with Web Document Scanning in a Timely Fashion

With our small team, we could not have completed WebLink ID’s development in a timely fashion if we tried to also develop our own image capture interface.  So we turned to Dynamsoft for an image capture SDK and it helped us deliver our application to market far quicker than anticipated. Honestly, the SDK was a primary driver to achieving good time to market and other revenue opportunities sooner. “

Kevin Freiburger,
Director of Product Management, VALID USA



VALID USA, Inc., headquartered in the Chicago area, is a wholly-owned subsidiary of its Brazilian parent company VALID S.A. The company directly owns and operates five US facilities with 900 employees. This includes more than 600,000 square feet of secure card manufacturing and personalization space. One of the company’s popular applications is WebLink ID. WebLink ID is an enrollment, credentials and application management web app. It is used to issue mass transit cards, student IDs, access control cards, and state driver’s license and ID documents. Thus, document scanning / image capture capabilities were a requirement for the software. VALID did not want to build this capability from scratch so it could instead focus on its core expertise. So, the team began a search for an image capture software development kit (SDK). After thorough research on multiple SDK options, the team settled on Dynamsoft’s ImageCapture Suite SDK. This SDK pre-accomplished the heavy lifting of development to connect web browsers to hardware.  So, not only did it help VALID narrow their focus and build better software, it helped shorten time to market. Today, the application is used by thousands of workers to capture millions of images annually in diverse environments. They include US state governments, K12 and higher education institutions, the public transit industry, and many other vertical markets that require photo identification.


VALID application design involves many stakeholders.  Product management and marketing departments perform market feasibility studies. Business analysts create functional outlines for VALID’s software.  Software architects create the software design and identify the development tools required to create the application. They also identify third party products that add value to the application.

When architecting software, it’s well known that it’s difficult to control locally connected devices, particularly from a web browser. This includes PC hardware and image capture peripherals such as document scanners, digital cameras, webcams, signature tablets, etc. And, precisely this device control was a capability required with WebLink ID. The software needed document scanning / image capture capabilities. But, VALID did not want to build this capability from scratch so it could instead focus on the team’s core expertise. This core expertise is building enrollment and management software to issue credentials.  So, the team began a search for a web-based image capture software development kit (SDK). After thorough research on multiple SDK options, the team settled on Dynamsoft’s ImageCapture Suite SDK.

Read the full case study>>

How to Upload Scanned Images to Amazon S3 Using Dynamic Web TWAIN SDK

In this tutorial, I’d like to share how to upload images, captured with Dynamic Web TWAIN(DWT), to Amazon S3. The adopted techniques include Dynamic Web TWAIN SDK, Amazon S3 REST API, JavaScript and PHP. You need to get familiar with DWT SDK and the Amazon S3 stuff (e.g., Bucket, Access Key, Secrete Key, Policy and so on).

As stated in Amazon S3 official documents, S3 supports HTTP Post request from client directly as long as the request is associated with the correct authenticated information about the policy and signature. To upload the image data captured by DWT SDK, you will need to:

1) Create Web pages contain DWT SDK, policy and signature information (encrypted)
2) Once scanning process finished, read the acquired image to a buffer, convert the buffer into BLOB, and send the BLOB data to S3.

Dynamic Web TWAIN Amazon S3 Demo

Upload images to Amazone S3

How to Send Data to Amazon S3

On the server side, you can write a web page which includes following code:

$bucket = "XXX"; //Specify the bucket which is the place or the folder name used for storing data on Amazon S3
$accesskey = "YourOwnAccessKey"; 
$secret = "YourOwnSecretKey"; //Specify the Access Key and Secret Key you obtained from your Amazon S3 account. You should keep this confidential

$policy = json_encode(array(
    'expiration' => '2018-08-06T12:00:00.000Z',
    'conditions' => array(
            'bucket' => $bucket
            'acl' => 'public-read'
)); //Create a policy that specifies what you permit and what you don’t permit for the data uploaded from a client web page
$base64Policy = base64_encode($policy);
$signature = base64_encode(hash_hmac("sha1", $base64Policy, $secret, $raw_output = true)); //Encode and encrypt these policies and signatures to keep them confidential, and store the encoded and encrypted values in the hidden input elements.

The code for the client side is trickier and might be error-prone if you are not familiar with S3 rules. Check the code below:

<input type="hidden" name="AWSAccessKeyId" value="<?php echo $accesskey; ?>">
<input type="hidden" name="policy" value="<?php echo $base64Policy; ?>">
<input type="hidden" name="signature" value="<?php echo $signature; ?>">
<li style="text-align: center">
<input id="btnUploadS3" type="button" value="Upload Image To S3" onclick ="btnUploadS3_onclick()"/></li>


function btnUploadS3_onclick() {
    if (!checkIfImagesInBuffer()) {
    var i, strHTTPServer, strActionPage, strImageType;
    _txtFileName.className = "";
    if (!strre.test(_txtFileName.value)) {
        _txtFileName.className += " invalid";
        appendMessage("Please input <b>file name</b>.<br />Currently only English names are allowed.<br />");
    for (i = 0; i < 4; i++) {
        if (document.getElementsByName("ImageType").item(i).checked == true) {
            strImageType = i + 1;
    var uploadfilename = _txtFileName.value + '.' + document.getElementsByName("ImageType").item(i).value;
    DWObject.SelectedImagesCount = 1;
var size = DWObject.GetSelectedImagesSize(strImageType);
var ary = new Array(size);
    for (var i =0; i<size; i++)
        ary[i] = 0;
    DWObject.SaveSelectedImagesToBytes(size, ary); // save the image data into buffer
// make xmlHttpRequest and send the binary data to S3
strActionPage = "http://s3.amazonaws.com/XXX/"; //The XXX would be your bucket name that you would like the uploaded data to be stored
    var UTF8_STR = new Uint8Array(ary);       // Convert to UTF-8...                
    var BINARY_ARR=UTF8_STR.buffer;         // Convert to buffer...    
    var dataBlob = new Blob([BINARY_ARR]); 
    var fd = new FormData();
    uploadfilename = 'Events/' + uploadfilename;
    // The common fields you need to specify include: KeyAWSAccessKeyIdAclPolicy,Signature and File. Note: the order of the fields (key, acl, policy, signature, and file should be the last one) matters. If you disorder them, you will fail to upload the image data.
    fd.append('key', uploadfilename);
    fd.append('AWSAccessKeyId', document.getElementsByName("AWSAccessKeyId").item(0).value);
    fd.append('acl', 'public-read');
    fd.append('policy', document.getElementsByName("policy").item(0).value);
    fd.append('signature', document.getElementsByName("signature").item(0).value);          
    fd.append("file",  dataBlob, uploadfilename);
    var xhr = new XMLHttpRequest();
    xhr.open('POST', strActionPage);
    xhr.addEventListener('load', function(e) {
        console.log('uploaded!', e)  // Successful upload!

Source Code

You can get the complete source code of the sample here.

To use Dynamic Web TWAIN to embed web scanning and upload to Amazon S3 cloud in your own application, you can download the 30-day free trial.

Free Online OCR Service with Dynamsoft TWAIN SDKs

Dynamsoft provides a free online OCR tool for end-users. Free Online OCR OCR_DWT

How to Implement the Online OCR Tool

While doing OCR online, there are four basic steps.

Step 1: load images

Using Dynamic Web TWAIN SDK, images can be loaded into an image view component with a few lines of JavaScript code:

function btnLoad_onclick() {
    _iHowManyImages = DWObject.HowManyImagesInBuffer;
    DWObject.IfShowFileDialog = true;
    DWObject.LoadImageEx("", 5, function() {
        g_DWT_PrintMsg("Loaded an image successfully.");
    }, function() {

    _iErrorCode = DWObject.ErrorCode;
    _strErrorString = DWObject.ErrorString;

Step 2: select a language

To create language and result options, just use HTML5 element <select>:

<select id=" ">
<option value=" "> </option>
<option value=" "> </option>

OCR_DWT_Result   Read more

Want to See How UGL Boosted Productivity after Migration to SourceAnywhere Version Control from Visual SourceSafe?

 Our developers have found the migration to using SourceAnywhere to be quite smooth, with minimal retraining required. In addition, we are benefiting far more in productivity because of SourceAnywhere’s significantly improved performance, particularly when using remote access.”

Bhargav Srinivas, 
Senior Project / Systems Engineer, UGL

UGL Logo


UGL® Limited, a global diversified services company with end-to-end outsourced engineering, construction, asset management and maintenance services resulting in annual revenue of $2.2+ billion has software developer teams that rely on a collaborative environment. For a long time, UGL used Microsoft® Visual SourceSafe software as a main repository of development activities. But, the software became old and was no longer supported – it stopped meeting UGL’s performance requirements. The company had to find a new source control solution to maintain a highly collaborative environment for developers regardless of their locations. UGL found Dynamsoft™ and its SourceAnywhere™ source control solution. SourceAnywhere was selected due to its similarities in operation to the previously used product. It also had available migration tools to enable an easy transition from SourceSafe. SourceAnywhere has proven itself in providing a significant boost in overall performance, particularly in security and remote access.


Software development teams from UGL’s engineering, fabrication, modeling, technical services and other related business sectors rely on a collaborative environment. To this end, the company has long employed the use of version control software to help foster developer collaboration. Over the years UGL relied on Microsoft® Visual SourceSafe software as the main repository of development activities.  But, it was heavily a flat file systems and support for it has ceased. And, the official replacement has been found to not suit UGL’s needs. The software has become quite slow to access repositories from satellite sites.  The team was able to improve remote site access. However, this was a limited improvement and required third party caching products to integrate with SourceSafe.

UGL had to find a new source control solution to maintain a highly collaborative environment for its developers regardless of their locations. As a result, strong security and performance for remote access would be key features to have in the new solution.

Read the full case study>>

Device Security: Factors for Changing the Sandbox Security Mechanism

It seems more and more sensors are being used in wireless communication modules with each new version of a device. We have accelerometers, gyroscopes, compasses, and more just in smartphones. These components are often integrated with other components – such as, Bluetooth, Wi-Fi, NFC, etc. – for enhanced data sharing. Such functionalities are helping to usher in the new age of the Internet of things (IoT). But, as devices and their applications share more data with each other, security risks increase. Manufacturers are addressing this in part by having implemented another layer of security: the Sandbox mechanism.

Apple Pay

Apple recently rolled out Apple Pay with the hopes to push and popularize e-wallet payments based on NFC. It is known that Apple uses the Sandbox technique to secure its applications. On iOS, this is done at the OS level. Sandbox is a security method used to isolate running programs from each other at an application or OS level. With it, developers can restrict applications or devices from accessing certain OS resources. It can add a layer of protection for user data when hackers exploit vulnerabilities in an applications or systems.

More companies like Apple, Google and Microsoft are moving to secure systems and web browsers with Sandbox. But, it may impact end user and developer behavior. For example, some users would rather root their devices to obtain more system rights, which circumvents Sandbox. If users or developers are willing to squander an added Sandbox layer of security, another question begs asking. Is it necessary to enforce a Sandbox technique on an OS or with web browsers?

Sandbox for Mobile

The capabilities of applications running in Sandbox mode can be extremely constricted. But, explicit policies can be setup to grant permissions. For example, an application can be allowed to access key system features and specific user data. Apple and Android devices provide a Sandbox mechanism. It’s popularly known that Android is more flexible in allowing applications to obtain greater permissions. Almost anyone who has downloaded an app is familiar with how Sandbox is implemented. When an app is installed, sometimes a user will be prompted to review permissions and decide to enable or disable them. Thus, he or she implemented Sandbox policies for that app.

Android’s enhanced security flexibility includes more possibilities without rooting. For example, users aren’t always restricted to downloading apps only from Google Play. They can download and install them from unknown or other sources. While it can present a greater security risk, this flexibility does help satisfy additional user requirements. Obviously there is a tradeoff between having more restrictions and being more open. It’s commonly known iOS is the most locked-down mobile operating system. Apple has restricted access to the OS far more than Google has for Android. In a way, iOS more automatically protects users whereas on Android, most users have to judge and apply restrictions. In some cases, users might not even understand what permissions they may or may not want to grant. So, it becomes easily arguable that an Android device is at much greater risk at getting infected by a virus or worm compared to an iOS devices. But, it’s also easily arguable that Android is more flexible in application use.

The industry needs better balance. A new question has to be addressed. How can manufacturers better balance an even more flexible user experience while enabling an even safer environment? The Sandbox technique must adapt to address this necessary shift.

Sandbox for Desktops

The Windows and Mac OSes provide official application stores for users and the stores employ the Sandbox mechanism. For example, by default in Mac OS X unverified third-party applications are now disallowed. But Sandbox on a desktop OS is different from a mobile OS. Mobile OSes were born with Sandbox. The desktop was born more open. For users who touched iOS before Mac OS, Sandbox comes across more acceptable and even convenient. But, for old users and developers that lived on Mac OS first, it is a little bit odd and harder to accept.

On Windows 8, the oddness is a bit different. For example, we can install Skype as a Windows App from their app store with Sandbox enforcement. But, we can also install it from the Skype website without Sandbox enforcement. The app version is different than the desktop version in other ways too. But, to users, Skype on a single machine should probably just be Skype. It’s difficult to grasp the same application appearing twice, operating slightly different from one another, including permissions. For many years on desktops, people were able to install applications with a few or no restrictions, let alone prompts to allow this or not allow that. Thus, it’s likely that on desktops the Sandbox mechanism will be an alternative but, not a replacement security measure.

Sandbox for Web Browsers

HTML5 technology is fast becoming mainstream in web browsers. As a result, leading browser developers are abandoning certain components. We’ve seen IE abandon ActiveX and Chrome abandon NPAPI, etc. More and more, web browsers are using Sandbox to replace old security techniques and disallow plugins from directly accessing system resources.

Sandbox can provide end users a more secure browsing environment. But, Sandbox might also be inconvenient for users and developers. Let’s explain. When web browsers automatically update in the background, users will likely not be aware of what web browser features have been changed. That is until they suddenly cannot access or use certain features or functionalities that previously worked. For example, an online banking systems might have been using ActiveX for password input and verification. If ActiveX is – unknowingly to the user – abandoned, how will users access their account? Thus, it’s likely that banks are in no rush to update their systems.

As more web browsers move to enforce the Sandbox mechanism, developers will have to figure out new plugin solutions. For example, WebSocket might be the answer to upgrade from old to new as soon as possible.

What’s the Path?

The Sandbox mechanism has proven itself excellent for securing devices, though not without hurdles. Developers by now fully understand it comes with tradeoffs. The main one is more application and device restrictions which obviously results in less freedom. Thus, it is hard to cover all user requirements. There’s no doubt that providing multiple options for the Sandbox security mechanism is ideal. It’s undeniable that more and more devices will talk to one another. The same is true of their applications. Thus, developers should move to face the challenges in Sandbox security now rather than later.

Copyright © 2014 Dynamsoft. All Rights Reserved. Privacy Statement | Site Map