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 three editions: ActiveX Edition, Plug-in edition and Mac Edition.
ActiveX edition is compatible with Microsoft Internet Explorer (both 32-bit and 64-bit) on Windows OS.
Plug-in edition is compatible with Gecko-based browsers, such as Firefox, Chrome, Safari and Opera etc. on Windows OS.
Mac edition is compatible with Safari, Firefox, Chrome and Opera on Mac OS 10.5 or above.
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?
The Online Demo of Dynamic Web TWAIN is available at
http://www.dynamsoft.com/demo/DWT/online_demo_scan.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.
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.
http://www.dynamsoft.com/Downloads/WebTWAIN-Sample-Download.aspx
12. What are the differences among ActiveX, Plug-in and Mac edition?
Dynamic Web TWAIN works with all mainstream browsers:
ActiveX Edition for Internet Explorer (32-bit & 64-bit) on Windows;
Plug-in Edition for Firefox, Chrome, Safari and Opera on Windows;
Mac Edition for Safari, Chrome, Firefox and Opera on Mac OS X.
To support all browsers in one scan page, you can detect the browser type and then direct users to the according Dynamic Web TWAIN CAB file (ActiveX edition), .XPI file (Plug-in Edition) and .pkg file (Mac Edition).
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.
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?
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?
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.
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:
|
3. How can I scan only a part of a picture?
VB Sample:
Twain.SelectSource Twain.IfShowUI = False |
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 = FalseTwain.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
You can use the IfSSL
property.
The following sample shows how to use the IfSSL
property.
<SCRIPT LANGUAGE="javascript">
function btnUpload_onclick() { WebTWAIN.HTTPPort = 80;
WebTWAIN.IfSSL = false; // if 80 is the port number of non-secure port
/*
WebTWAIN.HTTPPort = 443;
WebTWAIN.IfSSL = true; // if 443 is the port number of secure port
*/
WebTWAIN.HTTPUploadThroughPost("127.0.0.1", 0, "/SaveToFile.php", "image.jpg");
if (WebTWAIN.ErrorCode != 0)
alert(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
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.
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.
TWAIN ActiveX |
TWAIN Plug-in |
TWAIN Control |
TWAIN SDK |
Scanner COM
Software Configuration Management |
Version Control |
Source Control
Copyright © 2012 Dynamsoft Corporation. All Rights Reserved.