Dynamic Web TWAIN FAQ

General Questions:

  1. What is TWAIN?
  2. What is Dynamic Web TWAIN?
  3. For which purposes can I use Dynamic Web TWAIN?
  4. What the main advantages of Dynamic Web TWAIN are compared with other TWAIN which is also designed for web environment?
  5. Who do I contact if I need technical support?
  6. Where can I obtain a test application that uses Dynamic Web Twain?
  7. I would like to request some features in the next version of Dynamic Web TWAIN. Where do I make these requests?
  8. I have problems. What should I do?
  9. What is Live Help?
  10. What are the major differences between the Virtual Developer Service and usual customer support?
  11. Do you provide sample code? If yes, how can I get it?
  12. What are the differences between ActiveX and Plug-in?

Distribution Questions:

  1. How do I distribute my application?
  2. What files I need to include in the setup package of my program?
  3. Where can I find the LPK file, the CAB file or the XPI file?
  4. How to deploy Dynamic Web TWAIN on Web server?
  5. Can I deploy Dynamic Web TWAIN on Linux? If yes, how to?

License Questions:

  1. How many licenses do I need for a web-based application that runs on one server but can be accessed by many clients?
  2. Do I need a Developer License to do the development if I have Web Server License?
  3. What can I do when the Trial version is out of period expiration?
  4. How can I upgrade the Trial version to Full version?
  5. What are the differences between Developer License and Web Server License?

Features Questions:

  1. What operating systems will Dynamic Web TWAIN work with?
  2. What programming languages can Dynamic Web TWAIN ActiveX Edition work with?
  3. Does Dynamic Web TWAIN support NetScape or Firefox?
  4. Does Dynamic Web TWAIN support Database?
  5. Does Dynamic Web TWAIN support SSL?
  6. Can I use FTP upload and download with password?
  7. Can I upload and download images via proxy?
  8. Can Dynamic Web TWAIN work in a class library (DLL) project?

Programming:

  1. How can I acquire black-white images?
  2. How can I work without User Interface?
  3. How can I scan only a part of a picture?
  4. How can I select necessary device without device selection dialog?
  5. How can I disable progress indicator dialog when I acquire images without UI?
  6. How can I set resolution in the X and Y direction separately?
  7. How can I upload acquired image to the Web server?
  8. How to use ADF? We want to save each document in a separate file.
  9. How can I work with SSL?
  10. How can I add a new scanned image to an existed multi-page TIFF file?
  11. How can I rotate an image before I save it?
  12. How can I view a specified image if there are several images in buffer?
  13. How can I do a duplex scan?
  14. How to use Dynamic Web TWAIN in Visual C++ Non-Dialog Based Applications?
  15. How can I scan an inverted image?

Troubleshooting:

  1. Why do I fail to download the ActiveX control on the client machine?
  2. Why do I get the error "HTTP process error"?
  3. Why do I get the error "Your trial license has expired"?
  4. How to use Dynamic Web TWAIN in Firefox?
  5. Why do I get the error "Class not registered" in Delphi environment when I upgrade the Trial version to Full version?

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 has both ActiveX and Plug-in edition.

Plug-in edition is compatible with Gecko-based browsers, such as Netscape, Firefox.

ActiveX edition is compatible with Microsoft Internet Explorer and all COM-compatible environment, such as MS Office, VB, VC.

Dynamic Web TWAIN enables you to acquire images from any TWAIN compatible devices. Basically speaking, Dynamic Web TWAIN has all the functionalities that Dynamic TWAIN has, plus much functionality specifically designed for web environment. 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 V1.9. 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 web environment, such as uploading and downloading images through FTP or HTTP protocol.

3.    For which 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 support TWAIN standard. Dynamic Web TWAIN can upload and download images through FTP or HTTP protocol. Proxy is supported.

Also, you can use Dynamic Web TWAIN with any COM-compatible development tools, such as VB, VC, C#, VB.NET, Delphi.

4.    What the main advantage of Dynamic Web TWAIN when compared with other TWAIN which is also designed for web environment?

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

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

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

Upload and download image through HTTP and FTP.

Supports TIFF, JPEG, PDF and PNG compression.

5.    Who do I contact if I need technical support?

6.    Where can I obtain a test application that uses Dynamic Web Twain?

The Online Demo of Dynamic Web TWAIN is available at http://www.dynamsoft.com/Products/WebTWAIN_Demos.aspx

7.    I would like to request some features in the next version of Dynamic Web TWAIN.  Where do I make these requests?

If you have any requirement, please contact us by email TWAINsupport@dynamsoft.com. Your any request is very important to us.

8.    I have problems. What should I do?

The information on most of questions can be found in the documentation or in this FAQ.
Write to our support team to get more help. Our email address of support team is TWAINsupport@dynamsoft.com.

9.    What is Live Help?

Dynamsoft is committed to providing the best customer support in the industry. Our support team is ready to offer high quality, friendly and responsively technical support for our valued registered users.

10.    What are the major differences between the Virtual Developer Service and usual customer support?

11.    Do you provide sample code? If yes, how can I get it?

Yes, we provide sample code of Dynamic Web TWAIN in ASP, VB.NET, C#, PHP and JSP .

If you need a sample of Dynamic Web TWAIN, please access the following page to download samples.
https://www.dynamsoft.com/Secure/RegisterInfo_sample.aspx

12.    What are the differences between ActiveX and Plug-in?

The ActiveX edition can be used in Microsoft IE while the Plug-in edition can be used in Firefox and Netscape. If you are sure that your end user will use IE, then ActiveX edition is right for you. If you do not know which browser your end user will use, you may need both ActiveX and Plug-in editions.

Distribution Questions:

1.    How do I distribute my application?

Only DynamicWebTwainCtrl.dll and DynamicWebTwain.xpi can be distributable with end user application. All other files and documentations can NOT be distributed.

YOU MUST NOT DISTRIBUTE ".LIC" FILE OF DYNAMIC WEB TWAIN.

Dynamic Web TWAIN is very easy to distribute. Since Dynamic Web TWAIN is developed directly with pure Win32 API and assembly language, no additional supporting DLL or file is needed to distribute Dynamic Web TWAIN.

Please refer to the License Agreement for more info.

2.    What files I need to include in the setup package of my program?

You need DynamicWebTwainCtrl.dll in the setup package only.

3.    Where can I find the LPK file, the CAB file or the XPI file?

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

4.    How to deploy Dynamic Web TWAIN on Web server?

Before deploying Dynamic Web TWAIN on web server, make sure you have obtained the Web Server License of Dynamic Web TWAIN. For evaluation license, you can deploy Dynamic Web TWAIN on web server for evaluation purpose only.

For more information on how to deploy Dynamic Web TWAIN on Web server, please refer to Deploying Dynamic Web TWAIN on Web Server.

5.    Can I deploy Dynamic Web TWAIN on Linux? If yes, how to?

Yes, Dynamic Web TWAIN can be deployed on Linux.

For more information on how to deploy Dynamic Web TWAIN on Web server, please refer to Deploying Dynamic Web TWAIN on Web Server.

License Questions:

1.    How many licenses do I need for a web-based application that runs on one internet server but can be accessed by many clients?

You need one Web Server License.

Please refer to the License Agreement for more info.

2.    Do I need a Developer License to do the development if I have Web Server License?

Yes. Developer License is needed for development.

3.    What can I do when the Trial version is out of period expiration?

You can send a mail to our support team and ask for extending the period. We will be more than happy to extend the license for you.

4.    How can I upgrade the Trial version to Full version?

Please do the upgrade as follows:

If you use Delphi for development, please see also:
Why do I get the error "Class not registered" in Delphi environment when I upgrade the Trial version to Full version?

5.    What are the differences between Developer License and Web Server License?

Features Question:

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

Dynamic Web TWAIN can support Windows 95, 98, ME, NT, XP, 2000, 2003 and Vista.

2.    What programming languages can Dynamic Web TWAIN ActiveX Edition work with?

Dynamic Web TWAIN ActiveX Edition can be used in any COM-enlightened program language, such as C#, VB.NET, Visual C++, Visual Basic, Delphi, HTML/VBScript/JavaScript, and PowerBuilder and so on.

3.    Does Dynamic Web TWAIN support NetScape or Firefox?

Yes. Dynamic Web Edition Plug-in Edition is compatible with Netscape, Firefox and other Gecko-based browsers.

4.    Does Dynamic Web TWAIN support Database?

Yes. Dynamic Web TWAIN is able to save image files to the file system and database.

5.    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.

6.    Can I use FTP upload and download with password?

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

7.    Can I upload and download images via proxy?

Yes. You can use the ProxyServer property.

8.    Can Dynamic Web TWAIN work in a class library (DLL) project?

Dynamic Web TWAIN is not able to.

Programming:

1.    How can I acquire black-white images?

VB Sample:
Twain.OpenSource
Twain.IfShowUI = False
Twain.IfDisableSourceAfterAcquire = True
Twain.PixelType = 0      'Black - White image : 0, GRAY image: 1, RGB image: 2
Twain.AcquireImage

2.    How can I work without User Interface?

VB Sample:
Private Sub BeginScan()
    Twain.OpenSource
    Twain.IfShowUI = False    'Set without user interface
    Twain.IfDisableSourceAfterAcquire = True
    Twain.AcquireImage
End Sub
Private Sub Twain_OnPostTransfer()
Twain.SaveAsBMP "C:\SaveAsBMP.bmp", 0 End Sub

3.    How can I scan only a part of a picture?

VB Sample:
Twain.SelectSource
Twain.IfShowUI = False
Twain.OpenSource
'Set Image Layout
Twain.Unit = 0 'INCHES
Twain.SetImageLayout 0, 0, 5, 5
Twain.AcquireImage

4.    How can I select necessary device without device selection dialog?

VB Sample:
Dim lngNum As Long   'For loop.
Twain.OpenSourceManager
For lngNum = 0 To Twain.SourceCount - 1
If (Twain.SourceNameItems(lngNum) = "Specified device name" Then
Twain.SelectSourceByIndex (lngNum) End If Next
'If the specified source can't be found, the default source will be selected
Twain.AcquireImage

5.    How can I disable progress indicator dialog when I acquire images without UI?

VB Sample:
Twain.IfShowUI = False
Twain.IfDisableSourceAfterAcquire = True

Twain.OpenSource
Twain.IfShowIndicator = False
Twain.AcquireImage

6.    How can I set resolution in the X and Y direction separately?

VB Sample:
Twain.SelectSource
Twain.OpenSource

'Set XRESOLUTION current value.
Twain.Capability = ICAP_XRESOLUTION
Twain.CapType = TWON_ONEVALUE
Twain.CapValue = 300
If (Twain.CapSet = False) Then
    MsgBox "Failed to set the x-resolution." + vbCrLf + Twain.ErrorString, vbCritical
End If

'Set YRESOLUTION current value.
Twain.Capability = ICAP_YRESOLUTION
Twain.CapType = TWON_ONEVALUE
Twain.CapValue = 200
If (Twain.CapSet = False) Then
    MsgBox "Failed to set the y-resolution." + vbCrLf + Twain.ErrorString, vbCritical
End If
Twain.AcquireImage

7.    How can I upload acquired image to the Web server?

Dynamic Web TWAIN supports FTP, HTTP Put and HTTP Post upload method.

The following is an HTTP Put method sample:.

VB Sample:
Private Sub BeginScan()
    WebTwain.AcquireImage
End Sub
Private Sub WebTwain_OnPostTransfer()
If (WebTwain.HTTPUploadThroughPut("127.0.0.1", 0, "httpUploadFileTemp.bmp") = False) Then
    MsgBox WebTwain.ErrorString End If
End Sub

8.    How to use ADF? We want to save each document in a separate file.

VB Sample:
Dim iDocumentCounter As Integer
iDocumentCounter = 0 'Set initialize value
Private Sub BeginScan()
    Twain.OpenSource
    Twain.IfShowUI = False
    Twain.IfDisableSourceAfterAcquire = True Twain.IfTiffMultiPage = False 'Do not save as multi-page TIFF
If Twain.Duplex <> 0 Then
        Twain.IfDuplexEnabled = True 'Enable duplex
   End If
If Twain.IfFeederEnabled = True Then
        Twain.XferCount = -1 'Scan multiple images
     Twain.IfAutoFeed = True 'Auto feed
If Twain.IfFeederLoaded = True Then
         Twain.AcquireImage
End If
End If
End Sub
Private Sub Twain_OnPosttransfer()
iDocumentCounter = iDocumentCounter + 1
If Twain.SaveAsTIFF("c:\Image\" + Str(iDocumentCounter) + ".tif", 0) = False Then
    MsgBox Twain.ErrorString
End If
End Sub

9.    How can I work with SSL?

You can use the IfSSL property.

The following sample shows how to use the IfSSL property.

JavaScript Sample:
<SCRIPT LANGUAGE="javascript">
function btnUpload_onclick() {   frmScan.WebTwain.HTTPPort = 80;
   frmScan.WebTwain.IfSSL = false; // if 80 is the port number of non-secure port
   /*
   frmScan.WebTwain.HTTPPort = 443;
   frmScan.WebTwain.IfSSL = true; // if 443 is the port number of secure port
   */
   frmScan.WebTwain.HTTPUploadThroughPost("127.0.0.1", 0, "/SaveToFile.php", "image.jpg");
   if (frmScan.WebTwain.ErrorCode != 0)
      alert(frmScan.WebTwain.ErrorString);
   else //succeded
      alert("Successful"); }
</SCRIPT>

10.    How can I add a new scanned image to an existed multi-page TIFF file?

VB Sample:
Private Sub Scan_Click()
   Twain.AcquireImage
End Sub
Private Sub Twain_OnPostTransfer()
   Twain.CloseSource
   Twain.IfTiffMultiPage = True    Twain.SaveAsTIFF "SaveAsTIFF.tif", 0
   If (Twain.ErrorCode <> 0) Then        MsgBox (Twain.ErrorString)    Else 'succeded        MsgBox ("Successful")    End If
End Sub

11.    How can I rotate an image before I save it?

You can use the RotateLeft method and the RotateRight method.

VB Sample:
Private Sub Scan_Click()
   Twain.AcquireImage
End Sub
Private Sub RotateLeft_Click()
   Twain.RotateLeft 0
End Sub
Private Sub RotateRight_Click()
   Twain.RotateRight 0
End Sub

Also, you can use the ShowImageEditor method.

VB Sample:
Private Sub Scan_Click()
    Twain.AcquireImage
End Sub
Private Sub Twain_OnPostTransfer()
    Twain.CloseSource
    Twain.ShowImageEditor
    'You need to save the rotated image in the image editor before closing it
End Sub

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 with clicking "NextImage" or "PreImage" buttons.

VB Sample:
Private Sub NextImage_Click()
    If (Twain.HowManyImagesInBuffer = 0) Then
       MsgBox ("There is no image in buffer")
    End If
   Twain.CurrentImageIndexInBuffer = Twain.CurrentImageIndexInBuffer - 1
End Sub

Private Sub PreImage_Click()    If (Twain.HowManyImagesInBuffer = 0) Then
       MsgBox ("There is no image in buffer")
   End If
   Twain.CurrentImageIndexInBuffer = Twain.CurrentImageIndexInBuffer + 1
End Sub

13.    How can I do a duplex scan?

VB Sample:
Private Sub DuplexScan_Click()
   Twain.SelectSource
    Twain.OpenSource
    If Twain.Duplex <> 0 Then
        Twain.IfDuplexEnabled = True 'Enable duplex
   End If
    Twain.XferCount = 2
   Twain.MaxImagesInBuffer = 2
    Twain.AcquireImage
End Sub

14.    How to use Dynamic Web TWAIN in Visual C++ Non-Dialog Based Applications?

1. Adding Dynamic Web TWAIN to a Visual C++ Project.
2. Adding Code to the Project.

For more information about this question, please refer to Using Dynamic Web TWAIN in Visual C++ Non-Dialog Based Applications (SDI, MDI).

15.    How can I scan an inverted image?

You can use the PixelFlavor property.

VB Sample:
Private Sub Scan_Click()
   Twain.OpenSource

If Twain.PixelType = 0 Then      'Black - White image
   Twain.PixelFlavor = 0
   'Value = 0 Chocolate. Zero pixel represents darkest shade.
'Value = 1 Vanilla. Zero pixel represents lightest shade. End If

   Twain.AcquireImage
End Sub

Troubleshooting:

1.    Why do I fail to download the ActiveX control on the client machine?

The failure of loading ActiveX control has the following possible causes:

1. The security settings of IE on the client machine are incorrect.

Please verify the following security settings of IE to "Prompt" or "Enabled":
a) Download signed ActiveX controls
b) Run ActiveX Controls and plug-ins
c) Script ActiveX controls marked safe for scripting

The dialog box of the security setting can be launched from menu Tools>Internet Options. Then select the security tab.

2. The deployment of Dynamic Web TWAIN does not follow the right steps.

Please make sure the DynamicWebTwain.lpk file and the DynamicWebTWAIN.cab file are placed in the directory of your Web server.

For more information on how to deploy Dynamic Web TWAIN on Web server, please refer to Deploying Dynamic Web TWAIN on Web Server.

3. The DynamicWebTWAIN.cab file is invalid.

If the above is the not the cause and the problem still exists, please send the DynamicWebTWAIN.cab file to TWAINsupport@dynamsoft.com and we will check it for you.

2.    Why do I get the error "HTTP process error"?

The error "HTTP process error" has the following possible causes:

1. The write permission is not graded to the specified directory of Web server.

2. The action page returns something from Web server.
Dynamic Web TWAIN uses a special way to see if an image is uploaded and processed successfully by server. If the server returns 0 bytes, indicates success. Otherwise, indicates failure. In other words, when the uploaded image is processed successfully, the action page on the server should not return anything.

When you get the error "HTTP process error", please check the response string from the HTTP server. You can get the response string by using the HTTPPostResponseString property.

3.    Why do I get the error "Your trial license has expired"?

The Trial version of Dynamic Web TWAIN is downloaded for evaluation purpose. The evaluation period is 30 days.
You will get the error "Your trial license has expired" when the Trial version of Dynamic Web TWAIN is out of its period expiration.

Please refer to What can I do when the Trial version is out of period expiration for more information.

4.    How to use Dynamic Web TWAIN in Firefox?

You can try the following steps.


<html>
	<head>
		<title>Image Scanner Application</title>
	</head>
	<body>
		<p>This is a simple test page for the DynamicWebTWAIN plug-in.</p>
		<embed
			type="Application/DynamicWebTwain-Plugin"
			OnPostTransfer="OnPostTransferCallback()"
			width="200"
			height="200"
			PLUGINSPAGE="DynamicWebTwain.xpi">
		</embed>
		<input type="button" onclick="AcquireImage()" value="AcquireImage" />
		<script>
		function OnPostTransferCallback()
		{
			var Plugin = document.embeds[0];
			Plugin.CloseSource();
		}

		function AcquireImage()
		{
			var Plugin = document.embeds[0];
			Plugin.SelectSource();
			Plugin.AcquireImage();
		}
		</script>
	</body>
</html>

When you see a grey box with "No image" written on it, it indicates that Dynamic Web TWAIN Plug-in has been installed in Firefox.

5.    Why do I get the error "Class not registered" in Delphi environment when I upgrade the Trial version to Full version?

Please try the steps as follows.

After doing that, you will find the Dynamic Web TWAIN ActiveX control is no longer in the Component Palette. Then you need to re-import the Dynamic Web TWAIN into Delphi.