Dynamsoft Blog

The leading provider of version control solutions and TWAIN SDKs

Start Scanning in Latest Chrome and Firefox Now – Dynamic Web TWAIN 10.0 Released!

We are pleased to announce that Dynamic Web TWAIN 10.0 is now available! The new version added a HTML5 Websocket SDK which enables the development of document scanning modules within the HTML5-based  Chrome ® and Firefox® (version 27 and above) browsers.

It’s well known in the industry that leading browser providers are phasing out support of the Netscape Plugin Application Programming Interface (NPAPI). Developers will need to find non-NPAPI solutions to develop document scanning modules for browser-based document management applications. The new version of Dynamic Web TWAIN helps provide a clear migration path.

See Dynamic Web TWAIN HTML5 SDK in Action>>

Besides the new HTML5 SDK, the new version also added a HTML5 image viewer.
Check Out the Release Notes to learn more >>

Try out Dynamic Web TWAIN V10 for free

Let us know how you like this new version in the Comment section below.

Cheers!

SourceAnywhere 6.1 Released!

I’m pleased to announce that SourceAnywhere 6.1 is available. This is a SQL server-based version control software designed as a VSS replacement.

Below are the main improvements we made in this version.

  • Improved folder level Branch & Merge.
    • Type of Merge, Recover, Edit is now supported.
    • Merge result can be exported.
    • Improved merge by label.
  • Improved Project & File Branches Property interface.
  • Added auto detection of server names and instance names of SQL Servers when installing the server.
  • Other minor fixes and tweaks.

Check out the Release Notes >>

Download the 30-day free trial >>

How to upgrade to the latest version >>

If you have a valid software maintenance contract, please contact
sales@dynamsoft.com for FREE upgrade to this new version. Otherwise, you can either
renew maintenance or
purchase upgrade to get this version.

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

Cheers!

Scan Documents and Read Barcodes in ASP.NET

Document scan and barcodes recognition are vital parts of almost any document workflows. Acquire documents from scanners, use barcodes to separate batch documents or group documents and then save the files to disk, database, or document library are typical steps people take to organize paper documents.

In this article, I will provide a sample that show how to develop an ASP.NET application with TWAIN scanning and barcode recognition by using Dynamic Web TWAIN (a client-side TWAIN SDK) and Dynamsoft Barcode Reader for .NET on the backend.

remote barcode

Prerequisites

Using the Code

  1. In Visual Studio, create a new web application.
  2. Add Resources folder under the installation directory of Dynamic Web TWAIN, which includes the deployment files (CAB, MSI, PKG) of the TWAIN SDK, to the project.
  3. Add a web form page (BarcodeOnLineDemo.aspx) for document scanning. Embed Dynamic Web TWAIN control / plug-in to the page for displaying the scanned images.
    How to integrate Dynamic Web TWAIN to a web page? (Please refer to the ‘Building the “Hello World’ page” section of the guide)
  4. Add two buttons and a place holder, dwtcontrolContainer, for the Dynamic Web TWAIN object to the page.
    <body>
    <input id="btnScan"  type="button" value="Scan" onclick ="acquireImage();"/> 
    <input id="btnReadBarcode" type="button" class="buttonImage barcode"  value="" 
                                                onclick="ClickDeBarcode()" />
    <div id="dwtcontrolContainer"></div> // place holder of Dynamic Web TWAIN object
    </body>
    
  5. Write JS code to use Dynamic Web TWAIN to scan documents from scanners.
    //JavaScript
    
    function acquireImage() {
        _iHowManyImages = DWObject.HowManyImagesInBuffer;
        if (_divDWTSourceContainerID == "")
            DWObject.SelectSource();
        else
            DWObject.SelectSourceByIndex(document.getElementById(_divDWTSourceContainerID).selectedIndex);
        DWObject.CloseSource();
        DWObject.OpenSource();
        DWObject.IfShowUI = document.getElementById("ShowUI").checked;
    
        var i;
        for (i = 0; i < 3; i++) {
            if (document.getElementsByName("PixelType").item(i).checked == true)
                DWObject.PixelType = i; // set pixel type, B/W, gray, or color
        }
        DWObject.Resolution = document.getElementById("Resolution").value; // set resolution for scanning
        DWObject.IfFeederEnabled = document.getElementById("ADF").checked;
        DWObject.IfDuplexEnabled = document.getElementById("Duplex").checked;
        if (_bInWindows || (!_bInWindows && DWObject.ImageCaptureDriverType == 0))
            appendMessage("Pixel Type: " + DWObject.PixelType + "<br />Resolution: " + DWObject.Resolution + "<br />");
    
        DWObject.IfDisableSourceAfterAcquire = true;
        _iTwainType = 0;
        DWObject.AcquireImage();
    
        _iErrorCode = DWObject.ErrorCode;
        _strErrorString = DWObject.ErrorString;
    
    }
    
  1. Use Dynamic Web TWAIN’s HTTP Post method to upload the scanned images in buffer to server side for barcode recognition.
    //JavaScript
    function ClickDeBarcode() {
        DoBarcode();
        return true;
    }
    
    function DoBarcode() {
          var vType = (document.getElementById("ddl_barcodeFormat").options[document.getElementById("ddl_barcodeFormat").selectedIndex]).value;
        DWObject.SetHTTPFormField("FormatType", vType);
        strHTTPServer = _strServerName;
        DWObject.HTTPPort = _strPort;
    
        DWObject.HTTPUploadThroughPostEx(
                strHTTPServer,
                DWObject.CurrentImageIndexInBuffer,
                "Demo\\DNT-BarcodeTest\\DoBarcode.aspx",
                "Barcode.png",
                3
            );
    
        var responseText = DWObject.HTTPPostResponseString;
    
        if (responseText != "") {
            var tmpState = responseText.split(';');
    
            if (tmpState[0] == "OK") {
    
                var barcodeText = "";
                barcodeText += "ReadBarcode : " + tmpState[1] + "<br/>";
    
                var count = tmpState[2];
                barcodeText += "BarcodeCount: " + count + "<br/>";
    
                for (i = 0; i < count; i++) {
                    var text = tmpState[5 * i + 3];
                    var type = tmpState[5 * i + 4];
                    var len = tmpState[5 * i + 5];
                    var x = tmpState[5 * i + 6];
                    var y = tmpState[5 * i + 7];
    
                    barcodeText += ("barcode[" + (i + 1) + "]: " + text + "<br/>");
                    barcodeText += ("text len:" + len + "<br/>");
                    barcodeText += ("type:" + getBarcodeType(type) + "<br/>");
                    barcodeText += ("x: " + x + " y:" + y + "<br/>");
    
                    var strBarcodeString = text + "\r\n" + getBarcodeType(type);
                    DWObject.AddText(DWObject.CurrentImageIndexInBuffer, x, y, strBarcodeString, -1, 94700, 0, 1);
                }
                appendMessage(barcodeText);
            }
        }
    }
    
  2. Create DoBarcode.aspx to receive the scanned images and recognize the barcodes on the images.
    using BarcodeDLL; // imports Dynamsoft Barcode Reader DLLs, which exists under “\Redistributable\BarcodeResources” of the installation folder of Dynamic Web TWAIN
    //receive the image files
    HttpFileCollection files = HttpContext.Current.Request.Files;
    HttpPostedFile uploadfile = files["RemoteFile"];
    //read barcode
    
    try
                {
                    string strImageName = "";
                    int iFileLength;
                    HttpFileCollection files = HttpContext.Current.Request.Files;
                    HttpPostedFile uploadfile = files["RemoteFile"];
                    if (uploadfile != null)
                    {
                        strImageName = uploadfile.FileName;
                        iFileLength = uploadfile.ContentLength;
    
                        Byte[] inputBuffer = new Byte[iFileLength];
                        System.IO.Stream inputStream;
    
                        inputStream = uploadfile.InputStream;
                        inputStream.Read(inputBuffer, 0, iFileLength);
    
                        string strFormat = "0";
                        try
                        {
                            strFormat = HttpContext.Current.Request.Form["FormatType"].ToString();
                        }
                        catch { }
    
    
                        string strReturnValue = "";
                        try
                        {
                            string strBarcodeInfo = BarcodeMode.Barcode(inputBuffer, Convert.ToInt32(strFormat));
                            strReturnValue = "OK;" + strBarcodeInfo;
                        }
    
                        catch (Exception exp)
                        {
                            strReturnValue = "EXP;" + exp.Message.ToString();
                        }
                        finally
                        {
    
                        }
                        Response.Write(strReturnValue);
                        //return strReturnValue;
                    }
                }
    

 

Let me know if you have any questions when running the sample code or creating your own document scanning application.

Roadmap of Dynamic Web TWAIN

10.0 Preview (8/21/2014)
Release date: Aug 21
Features introduced:

  • New HTML5 WebSocket Edition to enable TWAIN scanning in Chrome and Firefox 27+ on Windows.
  • Added Disk Caching mechanism. This feature enables high volume document scanning which was limited by the physical memory size.
  • Added JPEG compression type to TIFF encoding/decoding. You can reduce the size of TIFF files significantly by using the JPEG compression.
  • Many image editing features have been improved such as: ChangeBitDepth, and GrayScale.

V10.0
Scheduled release date: Sep 19
This version will introduce the following features in the HTML5 WebSocket Edition:

  • Add a User Interface for native image viewing and editing
  • Optimize the performance of WebSocket-transferred operations, including scanning, image rendering, saving, editing, uploading, etc. You will find this new release much faster than the Preview version.

V10.1
Scheduled release date: Oct 10
Features to be introduced in the HTML5 WebSocket Edition:

  • Support Internet Explorer v10 or above
  • Enable reading barcodes, including 1D and 2D, on the server side or the client side.

V10.1.5
Scheduled release date: Oct 31
Features to be introduced:

  • Support browsers on Mac OS X
  • Enable reading text and mixed PDF files in the Load, Loadex, and HttpDownload methods

V10.2
Scheduled release date: Nov 18
Features to be introduced:

  • Support capturing images from webcams
  • Enable writing barcodes to scanned or loaded images
  • To be decided:
    • Enable Annotation on scanned or loaded images
    • Server-side OCR and client-side OCR

Say Good-Bye to NPAPI – Dynamic Web TWAIN 10.0 Preview (HTML5) is Released!

We have been working constantly to make sure our software is at the cutting edge. And today I have a piece of exciting news for you – Dynamic Web TWAIN 10.0 Preview (HTML5 based) is now available!

As you might have known, Chrome will stop the support for NPAPI Plugin at the end of 2014. Chrome will completely disable all NPAPI Plugins, including the Plug-in Edition of Dynamic Web TWAIN, at the end of 2014. By that time your end users will no longer be able to scan documents in Chrome with the old Dynamic Web TWAIN solution.

That’s where Dynamic Web TWAIN 10.0 Preview HTML5 based solution comes in. It enables web scanning in both Chrome & Firefox, and right, no need for the NPAPI technology anymore!

Try the new solution for Chrome & Firefox in action >>

Besides the HTML5 support to Chrome & Firefox, more exciting improvements are included in this new version –

  1. Added Disk Caching mechanism. This feature enables scanning in big volume which used to be limited by the size of physical memory.
  2. Added JPEG compression type to TIFF encoding/decoding. This feature reduces the size of TIFF files significantly.
  3. Much improved image editing features like ChangeBitDepth, GrayScale, etc.

For more details, please refer to Release Notes of 10.0 Preview.

I’d love to hear any comments or suggestions about this new version. Please don’t hesitate to contact us (support@dynamsoft.com).

Cheers!

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
WordPress SEO fine-tune by Meta SEO Pack from Poradnik Webmastera