Dynamsoft Blog

The leading provider of version control solutions and TWAIN SDKs

8 Rules to Follow When Using TWAIN for Your Image Capture Web App

Dynamsoft contributed an article on using TWAIN in web based document scanning APP to HTMLGOODIES. Start reading it below.

If you’ve used an imaging device to scan something, chances are you’ve come across TWAIN somewhere in the scanning software. Using the TWAIN standard to scan something has been made quite simple over the years. But, developing web applications to leverage the standard is not so easily done. Web application developers must consider several factors before embarking on such a task. 

TWAIN has been around since 1992. The TWAIN Working Group, which represents the imaging industry, put together the TWAIN standard. Many technology vendors in the imaging space make up the group. As the working group puts it, the purpose of TWAIN is “to provide and foster a universal public standard which links applications and image acquisition devices.” As a result, today we have the TWAIN standard. It is a software protocol and applications programming interface (API) that regulates communication between software applications and imaging devices.

Software and web app developers have long used TWAIN to link their applications with imaging devices. Today, this link is more critical than ever. Industries such as healthcare,financial and government largely use document management solutions for their paper-heavy industries. As more organizations move from a paper-based process to digital document management, the importance and use of TWAIN will only grow. In fact, many companies – from small businesses to large publicly-traded technology vendors – use TWAIN in their document management solutions. And, vendors sell these solutions into healthcare, financial, government and other such industries.

The use of image capturing within document management applications has many advantages. There’s a reduction in paper costs, a streamlining of workflow processes, simpler collaboration, enhanced security possibilities, and more. So, as web application developers continue to leverage TWAIN more and more, what are the critical elements to consider?

Read More

How to Configure Hyper-V in Windows 2008 R2

Hyper-V is a hypervisor-based Windows server developed by Microsoft. It enables platform virtualization on x86-64 systems. In this tutorial, we will introduce how to install and configure Hyper-V in Windows 2008 R2.

Environment

Processor: Intel(R)Xeon(R)CPU  E5645 @2.40GHz

Memory: 24GB

OS: Windows2008 R2 Enterprise

Hyper-V Installation

  1. First, make sure your OS supports Hyper-V. You can either check it in BIOS or download CUP-V to detect.
  2. Run server manager, click “Add Roles”, and check “Hyper-V”.
  3. Click start menu and run Hyper-V manager.

Parameters Configuration

Click start menu and run Hyper-V manager.

Hyper-V Manager

Click “New”, there are three options, respectively “Virtual Machine”, “Hard Disk” and “Floppy Disk”.

Hyper-V New

Below “New”, there is an option “Hyper-V Settings” which consists of “Server” and “User”. You can set virtual disk path, virtual machine path, keyboard and mouse according to your preferences.

Hyper-V Setting

Let’s take a look at “Virtual Network Manager”, which includes “Virtual Networks” and “Global Network Settings”. There are three types of “Virtual Networks”:

  • “External”: LAN connection
  • “Internal”: Ad hoc connection
  • “Private”: no network connection

Hyper-V Network

We can add a virtual network.

Hyper-V Network Manager

Virtual Machine Installation

Run new virtual machine wizard.

Hyper-V Virtual Machine
Allocate 1G memory.

Hyper-V Memory
Configure network connection.

Hyper-V Networking
Create a new virtual hard disk or choose an existing virtual hard disk.

Hyper-V Hard Disk
Choose the Installation options.

Hyper-V Options
Finished.

Hyper-V Done

Now, you can run the virtual machine.

Hyper-V Run

How to use DWT Plugin in Chrome 32 and above

Starting from Jan 1st 2014, new Chrome versions have stopped running the NPAPI plugin automatically. Google’s plan is for Chrome to stop supporting NPAPI altogether by the end of 2014.

Currently, the setting of plugins, as shown in figure 1, is still “Run automatically” by default.

chrome plugin

Figure 1

Even though currently when we access the online demo of Dynamic Web TWAIN, Chrome will automatically show a permission popup. Only if allow the permission, the plugin can work normally (figure 2).

 chrome popup

Figure 2

You have to click “Always run on this site” if you will frequently visit the site. Alternatively, you can manually add the site to Chrome settings: Settings -> Privacy -> Content settings -> Plug-ins -> Manage exceptions. See figure 3.

Figure 3

What if we set setting of Plug-ins “Block all”? We presume that Google will set “Block all” by default in mid-2014. Users will see a puzzle piece in place of the plug-in and a “Blocked plug-in” page action icon in the Omnibox. See figure 4 and figure 5. It will be harder to make a plugin work.

 chrome omnibox

Figure 4

chrome block

Figure 5

SourceAnywhere 5.1 Released!

We are pleased to announce that SourceAnywhere 5.1 is available. This is a SQL server-based version control software designed as a VSS replacement.

In this version, we have some new features and improvements.

• Added two new folder-level permissions, “Web Deploy” and “List Folder Content”.
• Enhanced Keyword Expansion support for TSQL.
• Improved performance of the SourceAnywhere Server during concurrent operation execution.
• Enhanced usability and user-friendliness during installation, and during regular program use.
• Other minor fixes and improvements.

Check out the Release Notes >>
Download the 30-day free trial >>
How to upgrade to the latest version? >>

If you have any comments or suggestions about this new version, please contact us at support@dynamsoft.com.

Cheers!

How to Add a Barcode to an Image in a Web Application

Introduction

Barcodes, especially QR codes, are widely used in modern society. Nowadays, when you go to a shopping mall, you can see many stores promoting commodities with QR codes. In this article, we will illustrate how to generate a barcode and add it to an image conveniently in a web application.

For anyone who wants to learn how to read barcodes, please refer to our previous article – how to read barcodes from an image in a web app.

Background

Here we use ImageCapture Suite which comes with a barcode processing SDK. ImageCapture Suite is a browser-based SDK for image acquisition, processing and secure uploading/downloading in web apps. In the latest version of ImageCapture Suite, we added a new feature in the barcode library – creating barcodes and add them to images online. We hope the new feature will help facilitate developers in developing document management solutions.

Coding Instruction

Prerequisites

  • JavaScript is the preferred programming language.
  • Familiar with developers’guide of ImageCapture Suite.

Load an Image

The first step is to load an image. We can implement this by using the following code.

Create a canvas for image display

<div id="dwtcontrolContainer"></div>

Initialization

<!--include the necessary js file-->
<script src="scripts/dynamsoft.imagecapturesuite.initiate.js"></script>
<script type="text/javascript" language="javascript"> 
var gImageCapture; 
var _imageCaptureParam = { 
 'productKey': '',
 'containerID': 'dwtcontrolContainer',
 'width': 440, 
 'height': 600 
}; 

(function() { 
 gImageCapture = new Dynamsoft.ImageCapture(_imageCaptureParam);
})();
</script>

Add a button and relevant event

<input type="button" value="Load Image" onclick ="loadImage();"/>
<script type="text/javascript" language="javascript"> 
function loadImage() { 
var DWObject = gImageCapture.getInstance(); 
if(DWObject) { 
DWObject.IfShowFileDialog = true;
    DWObject.LoadImageEx("", 5); // LoadImageEx(String FileName, Long ImageType)
} 
} 
</script>

Generate a Barcode & Add it to the Image

The barcode formats for encoding include AZTEC, CODABAR, CODE 39, CODE 93, CODE 128, DATAMATRIX, MAXICODE, PDF417, and QR CODE. Here we show the demo using QR CODE. The parameters used for barcode writer include:

  1. Barcode Format: “QR_Code”
  2. Barcode Content: “Dynamsoft”
  3. Barcode Content Location: x = 100, y = 100
  4. Scale: 10
function J_AddBarcoding() {
var barcodeVerStr = DWObject.BarcodeVersion;
// check the barcode library version.
    if (!barcodeVerStr || barcodeVerStr != _strBarcodeVersion) {
        if (location.hostname != "") {
            var strHostIP = location.hostname;
            DWObject.HTTPPort = location.port == "" ? 80 : location.port;
            var CurrentPathName = unescape(location.pathname); // get current PathName in plain ASCII	
            var CurrentPath = CurrentPathName.substring(0, CurrentPathName.lastIndexOf("/") + 1);
            var strBarcodepath = CurrentPath + "Resources/barcode.zip";
            DWObject.HTTPDownloadResource(strHostIP, strBarcodepath, "barcode.zip");
        }
    }

    var barcodeformat;
    barcodeformat = document.getElementById("ddl_AddbarcodeFormat").value;

    var barcodeContent;
    barcodeContent = document.getElementById("txtBarcodeContent").value;

    var humanReadableText;
    humanReadableText = document.getElementById("txtHumanReadableText").value;

    var locationX;
    locationX = document.getElementById("txtLocationX").value;   

    var locationY;
    locationY = document.getElementById("txtLocationY").value;

    var scale;
    scale = document.getElementById("txtScale").value;

    DWObject.AddBarcode(DWObject.CurrentImageIndexInBuffer, barcodeformat, barcodeContent, humanReadableText, locationX, locationY, scale); // encode the content as QR code, and add it to the buffered image

    //DWObject.  Barcoding Call XActive.
    J_SetBtnProcessingAndText("btnAddBarcode", false, "Add Barcode");
}

The result is shown in the figure.

barcode result

Save the Image

Finally, we can save the image to the local disk.

function btnSave_onclick() {
    if (!checkIfImagesInBuffer()) {
        return;
    }
    var i, strimgType_save;
var NM_imgType_save = document.getElementsByName("imgType_save");
// find the selected image format 
    for (i = 0; i < 5; i++) {
        if (NM_imgType_save.item(i).checked == true) {
            strimgType_save = NM_imgType_save.item(i).value;
            break;
        }
    }
    DWObject.IfShowFileDialog = true;
    _txtFileNameforSave.className = "";
    var bSave = false;
    if (!strre.test(_txtFileNameforSave.value)) {
        _txtFileNameforSave.className += " invalid";
        _txtFileNameforSave.focus();
        appendMessage("Please input <b>file name</b>.<br />Currently only English names are allowed.<br />");
        return;

Run or deploy the application on web server

The complete source code can be downloaded from the article.

There is a “Scripts\ProductKey.js” file with a temporary trial product key. If you get license error when running the sample, you can download ImageCapture Suite from Dynamsoft’s website to get a valid trial license. ImageCapture Suite 30-Day Free Trial Download

To test barcode reading from different client machines, you can simply copy the sample code with ImageCapture Suite to your web server (IIS, Apache or Tomcat). Users only need to download and install the ActiveX/Plugin in the browser on their first visit to the web page. More details on how to deploy ImageCapture Suite

The online demo is also available for your reference.

ImageCapture Suite Barcode Online Demo

Support

Is your organization currently undergoing a document management project? Have you deployed Dynamsoft’s SDK? If so, how has it helped? Let us know in the comments section or by contacting us. You can also contact us if you need any help to get this sample code up and running. To do so, reach us by email at support@dynamsoft.com. For pricing or licensing questions, call us at 1-877-605-5491 or email our sales team at sales@dynamsoft.com.

 

Copyright © 2013 Dynamsoft. All Rights Reserved. Privacy Statement | Site Map
The leading provider of version control solutions and TWAIN SDKs
  • Sign into hosted web portal
  • Contact us
Dynamic Web TWAIN - TWAIN ActiveX | Web Scanning Control