Dynamic Web TWAIN logo

FAQ about Dynamic Web TWAIN

General Questions

  • 1. What is TWAIN?

    TWAIN is a protocol and Application Programming Interface (API) that standardizes communication between an application and image acquisition devices such as scanners and digital cameras. This standard allows a developer to make standard calls to any image acquisition device that supports TWAIN. Thus the application would not have to be rewritten to support every device. TWAIN has been in existence since 1992 and is governed by the TWAIN Working Group.

  • 2. What is Dynamic Web TWAIN?

    Dynamic Web TWAIN is a TWAIN-based scanning SDK specifically designed for web applications. It enables you to acquire images from any TWAIN compatible devices.

    With the carefully designed interface, and the built-in wizard mode, Dynamic Web TWAIN is very easy to use. You can typically do your TWAIN job in several lines of code. At the same time, Dynamic Web TWAIN is very powerful. It is compatible with TWAIN specification V2.1. It has built-in JPEG encoder and decoder. It supports all three image transfer modes and many other features.

    Dynamic Web TWAIN has many features specifically designed for the web environment, such as uploading and downloading images through FTP or HTTP protocol.

  • 3. Which edition(s) of Dynamic Web TWAIN should I use?

    Dynamic Web TWAIN has several editions: ActiveX, HTML5 for Windows, HTML5 for Mac and HTML5 for Linux. Based on the browser(s) your end users use, you can decide which edition(s) to use.

    • ActiveX: supports IE 6-9 on Windows by default, it can be configured to support IE 10, 11 as well;
    • HTML5 for Windows: supports Firefox/Chrome 27+, IE 10/11 and Edge on Windows;
    • HTML5 for Mac: supports Chrome/Firefox 27+, Safari 7+ on Mac OS.
    • HTML5 for Linux: supports Chrome/Firefox 27+ on Ubuntu 10+, Debian 8 and Fedora 19+.

    See the edition comparison chart to learn more details ›

  • 4. Does the use of the Dynamic Web TWAIN require installation of twain drivers?

    Yes. Dynamic Web TWAIN communicates with the TWAIN driver of a device (scanner/camera/capture card/etc.) to control it to acquire and transfer images, so the driver needs to be installed on client machines.

  • 5. For what purposes can I use Dynamic Web TWAIN?

    Dynamic Web TWAIN can be used for controlling any work of scanners, digital cameras and any other devices which supports the TWAIN standard. Dynamic Web TWAIN can upload and download images through FTP or HTTP protocol. Proxy is also supported.

  • 6. What is the main advantages of Dynamic Web TWAIN compared with other TWAIN SDKs which are also designed for web environment?

    The main advantages of Dynamic Web TWAIN is that Dynamic Web TWAIN is a TRUE web scanning solution.

    It is compatible with Internet Explorer, Chrome, Firefox and other browsers.

    It is flexible and very small. Absolutely no supporting DLL is needed for distribution.

    It can be used to upload and download image through HTTP and FTP.

    It supports TIFF, JPEG, PDF and PNG compression.

  • 7. Where can I obtain a test application that uses Dynamic Web TWAIN?

    You can get samples of Dynamic Web TWAIN from our sample gallery.

    You can also find some basic samples with source code after installing the Dynamic Web TWAIN trial version.

  • 8. I'm having difficulties when using the SDK. What should I do?

    Our Knowledge Base system and online documentation is always a good place for troubleshooting. If you can't find an answer there, please email us at support@dynamsoft.com.

  • 9. What are the major differences between the Virtual Developer Service and usual customer support?
    • With the Virtual Developer Service, we communicate with you closely, analyze your requirements, propose tech solutions, and write the code, help you integrate the code in your project, do the test and maintenance.
    • With standard customer support, you usually need a developer working on the TWAIN module who would then ask questions to our technical support team. With the Virtual Developer Service, you do not need a developer working on the TWAIN module and our developers participate in your project as a team member.

Distribution Questions

  • 1. Where can I find the CAB file, MSI file, or PKG file, etc.?

    These files can be found under the \Resources\ folder in the installation directory of Dynamic Web TWAIN.

  • 2. How do I deploy Dynamic Web TWAIN on a web server?

    Please refer to Deploying Dynamic Web TWAIN on Web Server for more info.

  • 3. Can I deploy Dynamic Web TWAIN on Linux servers? If yes, how to?

    Yes, Dynamic Web TWAIN can be deployed on Linux Servers.

    Please refer to Deploying Dynamic Web TWAIN on Web Server for more information.

Features Questions

  • 1. What operating systems will Dynamic Web TWAIN work with?

    Windows XP, Vista, 7/8/10, etc.

    • IE 6-9: ActiveX
    • IE 10-11: HTML5/ActiveX
    • Edge: HTML5
    • Chrome/Firefox 26-: NPAPI Plug-in (obsolete)
    • Chrome/Firefox 27+: HTML5

    Mac OS X 10.6 and later

    • Chrome/Firefox 26-, Safari 6-: NPAPI Plug-in (obsolete)
    • Chrome/Firefox 27+, Safari 7+: HTML5

    Ubuntu 10+, Debian 8 and Fedora 19+

    • Chrome/Firefox 27+: HTML5
  • 2. Does Dynamic Web TWAIN support Chrome or FireFox?

    Yes. Dynamic Web TWAIN provides Plugin edition to work with old NPAPI-compatible Chrome and Firefox versions. Since Dynamic Web TWAIN 10, HTML5 Edition is introduced to enable TWAIN scanning in Chrome and Firefox V27+ on Windows.

  • 3. Does Dynamic Web TWAIN support Database?

    Yes. Dynamic Web TWAIN is able to save image files to the file system and database. Please check this article for more details.

  • 4. Does Dynamic Web TWAIN support SSL?

    Yes. Dynamic Web TWAIN supports SSL.

    For the information on how to work with SSL, please refer to How can I work with SSL.

  • 5. Can I use FTP upload and download with password?

    Yes. You can use the FTPUserName property and the FTPPassword property.

  • 6. Does Dynamic Web TWAIN work in a class library (DLL) project?

    No, it doesn't.

  • 7. Does Dynamic Web TWAIN support Barcode Reader or OCR?

    You can use Dynamic Web TWAIN with Dynamsoft Barcode Reader for barcode reading.

    For OCR, we have 2 options for you:

  • 8. Can I scan large amounts of documents?

    With IfAllowLocalCache enabled, you are able to scan thousands of images since extra images will be on disk as long as buffer size hits 800MB.

    The data will be encrypted and stored "C:\Documents and Settings\{User Name}\Application Data\Dynamsoft\cache" or "C:\WINDOWS\SysWOW64 {or system32}\Dynamsoft\DynamicWebTwain\ForChrome\cache". When the scan application is closed, the cached data will be removed from disk automatically.

Programming Questions

  • 1. How can I acquire black-white images?
    DWObject.OpenSource();
    DWObject.IfShowUI = false;
    DWObject.IfDisableSourceAfterAcquire = true;
    DWObject.PixelType = EnumDWT_PixelType.TWPT_BW; //Black - White 
    image : EnumDWT_PixelType.TWPT_BW, GRAY image: 
    EnumDWT_PixelType.TWPT_GRAY, RGB 
    image: EnumDWT_PixelType.TWPT_RGB
    DWObject.AcquireImage();
  • 2. How can I work without the User Interface?
    function BeginScan(){
        DWObject.OpenSource();
        DWObject.IfShowUI = false; //set without user interface
        DWObject.IfDisableSourceAfterAcquire = true;
    
        DWObject.AcquireImage();
    }
    
    function DWObject_OnPostTransfer(){
        DWObject.SaveAsBMP("C:\\temp.bmp",0);
    }
  • 3. How can I scan only a certain part of a paper?
    DWObject.SelectSource();
    DWObject.OpenSource();
    DWObject.IfShowUI = false;
    //Set Image Layout
    DWObject.Unit = EnumDWT_UnitType.TWUN_INCHES;
    DWObject.SetImageLayout(0, 0, 5, 5);
    DWObject.AcquireImage(); 
  • 4. How can I select a device without showing the device selection dialog?
    DWObject.OpenSourceManager();
    
    for(i = 0, i<=DWObject.SourceCount - 1,i++){
        if (DWObject.GetSourceNameItems(i) == "Specified device name")
            DWObject.SelectSourceByIndex (i);
    }
    
    //if can't find the specified source, it'll select default source
    DWObject.AcquireImage(); 
  • 5. How can I disable progress indicator dialog when I acquire images without UI?
    DWObject.IfShowUI = false;
    DWObject.IfDisableSourceAfterAcquire = true;
    DWObject.OpenSource();
    DWObject.IfShowIndicator = false;
    DWObject.AcquireImage();
  • 6. How can I set horizontal and vertical resolutions separately?
    DWObject.SelectSource();
    DWObject.OpenSource();
    
    //Set XRESOLUTION current value.
    DWObject.Capability = 0x1118; //ICAP_XRESOLUTION
    DWObject.CapType = 5; //TWON_ONEVALUE
    DWObject.CapValue = 300;
    if (DWObject.CapSet == false){
        alert( "Failed to set the x-resolution. " + DWObject.ErrorString);
    }
    
    //Set YRESOLUTION current value.
    DWObject.Capability = 0x1119; //ICAP_YRESOLUTION
    DWObject.CapType = 5; //TWON_ONEVALUE
    DWObject.CapValue = 200;
    if (DWObject.CapSet == false){
       alert( "Failed to set the y-resolution." + DWObject.ErrorString);
    }
    
    DWObject.AcquireImage();
  • 7. How can I upload to the Web server?
    DWObject = document.getElementById("dwtcontrolContainer");
    //dwtcontrolContainer is the id of the Dynamic Web TWAIN on the page (An object or an embed).
    function btnScan_onclick() 
    {
    DWObject.SelectSource();
    DWObject.OpenSource();
    DWObject.AcquireImage();
    }
    function btnUpload_onclick() 
    {
    var strActionPage;
    var strHostIP;
    var CurrentPathName = unescape(location.pathname); // get current PathName in 
    plain ASCII 
    var CurrentPath = CurrentPathName.substring(0, CurrentPathName.lastIndexOf("/") 
    + 1); 
    strActionPage = CurrentPath + "SaveToFile.aspx"; //the ActionPage's file path
    strHostIP = "localhost"; //The host's IP or name 
    DWObject.HTTPPort = 80; 
    DWObject.HTTPUploadThroughPost(strHostIP,0,strActionPage,"imageData.tif");
    if (DWObject.ErrorCode != 0)
    alert(DWObject.ErrorString);
    else //succeed
    alert("Image Uploaded successfully");
    }
  • 8. How to use ADF? We want to save each document in a separate file.
    var iDocumentCounter =0;
    
    function BeginScan(){
        DWObject.OpenSource();
    
        DWObject.IfShowUI = false;
        DWObject.IfDisableSourceAfterAcquire = true;
        if(DWObject.Duplex != TWDX_NONE)
            DWObject.IfDuplexEnabled = true; //enable duplex
    
    DWObject.IfFeederEnabled = true;
        if (DWObject.IfFeederEnabled == true){
             DWObject.XferCount = -1;
    
             if(DWObject.IfFeederLoaded == True)
                 DWObject.AcquireImage();
        }
    }
    
    function DWObject_OnPosttransfer(){
    iDocumentCounter = iDocumentCounter + 1;
    
    if(DWObject.SaveAsBMP("C:\\Image\\" + iDocumentCounter + ".bmp", 0) == false)
        alert( DWObject.ErrorString);
    }
  • 9. How can I work with SSL?

    You can use the IfSSL property. The following JavaScript Sample shows how to use the IfSSL property.

    function btnUpload_onclick() 
    {
       DWObject.HTTPPort = 80; 
       DWObject.IfSSL = false; // if 80 is the port number of 
    non-secure port
    
       /* 
       DWObject.HTTPPort = 443; 
       DWObject.IfSSL = true; // if 443 is the port number of secure 
    port
       */
    
       DWObject.HTTPUploadThroughPost("127.0.0.1", 0, 
    "/SaveToFile.php", "imageData.jpg");
    
       if (DWObject.ErrorCode != 0)
          alert(DWObject.ErrorString);
       else //succeed
         alert("Successful");
    }
  • 10. How can I add a newly scanned image to an existing multi-page TIFF file?
    function Scan_Click(){
       DWObject.AcquireImage();
    }
    function DWObject_OnPostTransfer(){
       DWObject.CloseSource();
       DWObject.IfTiffMultiPage = true;
       DWObject.SaveAsTIFF("SaveAsTIFF.tif", 0);
       if (DWObject.ErrorCode != 0)
          alert (DWObject.ErrorString);
       else //succeed
          alert ("Successful");
    }
  • 11. How can I rotate an image before I save it?

    You can use the RotateLeft method and the RotateRight method.

  • 12. How can I view a specified image if there are several images in buffer?

    You can view a specified image or go through all the images in buffer by updating the value of the API CurrentImageIndexInBuffer.

    function NextImage_Click(){
       if (DWObject.HowManyImagesInBuffer == 0) 
       
          alert ("There is no image in buffer");
    
       DWObject.CurrentImageIndexInBuffer += 1;
    }
  • 13. How can I do a duplex scan?
    function DuplexScan_Click(){
       DWObject.SelectSource();
       DWObject.OpenSource();
       DWObject.IfShowUI = false;
       DWObject.IfDuplexEnabled = true; //enable duplex
       DWObject.AcquireImage();
    } 
  • 14. How can I scan an image in inverted colors?

    You can use the PixelFlavor property.

Purchase and License Questions