Questions
General Questions
- What is TWAIN?
- What is Dynamic .NET TWAIN?
- For which purposes can I
use Dynamic .NET TWAIN?
- Who do I contact if I need
technical support?
- I would like to request some features in the next version of Dynamic .NET TWAIN. Where do I make these requests?
- I have problems. What should I do?
- What is Live Help?
- Do you provide sample code? If yes, how can I
get it?
- What operating systems will Dynamic .NET TWAIN work with?
- What programming languages can Dynamic .NET TWAIN work with?
Distribution Questions
- How do I distribute my application?
- What
files I need to include in the setup package of my program?
License Questions
- Why do I get the error "Your Dynamic .NET TWAIN serial number is invalid "?
- How to add license key on my develop machine?
Programming Questions
- How can I acquire black-white
images?
- How can I work without User
Interface?
- How can I scan only a part of a
picture?
- How can I call my scanner UI without acquiring an image?
- How
can I select necessary device without device selection dialog?
- How can I disable progress indicator dialog when I acquire images without UI?
- How can I
set resolution in the X and Y direction separately?
- How can I upload acquired image to the Web server?
- How to use ADF? We want to save each document in a
separate file.
- How can I work with SSL?
- How
can I add a new scanned image to an existed multi-page TIFF file?
- How can I rotate an image
before I save it?
- How
can I view a specified image if there are several images in buffer?
- How can I do a duplex scan?
- How can I scan an inverted image?
Answers
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 .NET TWAIN?
Dynamic .NET TWAIN is a .NET component which enables you to acquire images from any TWAIN compatible devices.
It is specially designed for Microsoft .NET Framework-based desktop scanning applications. It enables you to acquire images from any TWAIN compatible devices.
With the carefully designed
interface, and the built-in wizard mode, Dynamic .NET TWAIN is very easy to use. You can typically do your TWAIN job in several lines of code.
At the same time, Dynamic .NET TWAIN is very powerful. It is compatible with TWAIN specification V1.9.
It supports all three image transfer modes and many other features.
3. For which
purposes can I use Dynamic .NET TWAIN?
Dynamic .NET TWAIN is designed for Microsoft .NET Framework-based desktop scanning applications. It can be used for controlling any work of scanners, digital
cameras and any other devices which support TWAIN standard. Dynamic .NET TWAIN
can upload and download images through FTP(S) or HTTP(S) protocol. Proxy is
supported.
4. Who do I
contact if I need technical support?
- We provide at least 20 hours Live Support per
weekday. Live Support is an online chat
service for our customers to interact with our support professional in real
time.
- You can email our support team. Our email address for Dynamic .NET TWAIN is NetTwain@dynamsoft.com.
5. I would like to request some features in the next version of Dynamic .NET TWAIN. Where do I make these requests?
If you have any requirement, please contact us by email. Your any request
is very important to us. Please email to NetTwain@dynamsoft.com.
6. 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 NetTwain@dynamsoft.com.
You can also check our knowledge base to see whether you can find a solution there.
7. What is Live Help?
Dynamsoft is committed to providing the best customer support in the
industry. Our support team is ready to offer no time limit, high quality,
friendly and responsively technical support for our valued registered users.
We provide at least 20 hours Live Support per weekday. Live Support is an
online chat service for our customers to interact with our support professional
in real time.
- Recognizing our world wide customers locate in different time zones, we proudly
provide at least 20 hours Live Chat Support (Live Help) each day from Monday to
Friday.
- If you visit between Monday and Friday, and happen to see our Live
Help support professional is offline, please wait a moment and
our support professional will be with you shortly.
- When the Live Help support professional is offline, you can also leave a
message and we would response promptly.
8. Do you provide sample code? If yes,
how can I get it?
Yes, we provide sample code
of Dynamic .NET TWAIN in VB.NET and C#. You can find the samples in program group of Dynamic .NET TWAIN after installation.
9. What operating systems does Dynamic .NET TWAIN work with?
Dynamic .NET TWAIN supports Windows 95, 98, ME, NT, XP, 2000, 2003, Vista, 2008 and Windows 7.
10. What programming languages does Dynamic .NET TWAIN work with?
Dynamic .NET TWAIN can be used with C# and VB.NET.
Distribution Questions:
1. How do I distribute my
application?
Runtime distribution is royalty free.
Normally, you only need to distribute DynamicDotNetTwain.dll with end user application. If you also use the OCR add-on in the application, you should distribute DynamicOCR.dll, DynamicOCRx64.dll and the tessdata folder as well. All other files and documentations can NOT be distributed. YOU MUST NOT DISTRIBUTE ".LIC" FILE OF Dynamic .NET TWAIN.
Dynamic .NET TWAIN is very easy to distribute. It supports Xcopy deployment. You only need to distribute DynamicDotNetTwain.dll (if necessary, DynamicOCR.dll, DynamicOCRx64.dll and the tessdata folder as well) with your desktop application. The DLL file(s) does not need to be registered.
2.
What files I need to include in the setup package of my program?
As mentioned above, you only need DynamicDotNetTwain.dll in the setup package and DynamicOCR.dll, DynamicOCRx64.dll plus the tessdata folder if necessary.
License Questions:
1. Why do I get the error "Your Dynamic .NET TWAIN serial number is invalid"?
Please check this article for solution.
2. How to add license key on my develop machine?
You can add your license key into Licensing Tool on your develop machine. Or, assign serial number to LicenseKeys Property when initializing the control like this:
dynamicDotNetTwain1.LicenseKeys = "xxxx"; // Please replace “xxxx” with your valid license key;
If you have more than one key, please separate them by Semicolons.
Programming Questions
1. How can I acquire
black-white images?
Twain1.OpenSource();
Twain1.IfShowUI = false;
Twain1.IfDisableSourceAfterAcquire = true;
Twain1.PixelType = Dynamsoft.DotNet.TWAIN.Enums.TWICapPixelType.TWPT_BW;
Twain1.AcquireImage();
2. How can I work without
User Interface?
private void BeginScan()
{
Twain1.OpenSource();
Twain1.IfShowUI = false; // set without user interface
Twain1.IfDisableSourceAfterAcquire = true;
Twain1.AcquireImage();
}
private void Twain1_OnPostTransfer()
{
Twain1.SaveAsBMP("c:\temp.bmp", 0);
}
3. How can I scan only a
part of a picture?
Twain1.SelectSource();
Twain1.OpenSource();
Twain1.IfShowUI = false;
// Set Image Layout
Twain1.Unit = Dynamsoft.DotNet.TWAIN.Enums.TWICapUNits.TWUN_INCHES; // INCHES
Twain1.SetImageLayout(0, 0, 5, 5);
Twain1.AcquireImage();
4. How can I call my scanner UI without acquiring an image?
This feature is supported by EnableSourceUI.
Twain1.EnableSourceUI();
5.
How can I select necessary device without device selection dialog?
Twain1.OpenSourceManager();
int count = Twain1.SourceCount;
for (short lngNum = 0; lngNum < count; lngNum ++)
{
if (Twain1.SourceNameItems(lngNum) == "Specified device name")
{
Twain1.SelectSourceByIndex (lngNum);
break;
}
}
// if can't find the specified source, it'll select default source
Twain1.AcquireImage();
6. How can I disable progress indicator dialog when I acquire images
without UI?
Twain1.IfShowUI = false;
Twain1.IfDisableSourceAfterAcquire = true;
Twain1.OpenSource();
Twain1.IfShowIndicator = false;
Twain1.AcquireImage();
7.
How can I set resolution in the X and Y direction separately?
Twain1.SelectSource();
Twain1.OpenSource();
//Set XRESOLUTION current value.
Twain1.Capability = Dynamsoft.DotNet.TWAIN.Enums.TWCapability.ICAP_XRESOLUTION;
Twain1.CapType = Dynamsoft.DotNet.TWAIN.Enums.TWCapType.TWON_ONEVALUE;
Twain1.CapValue = 300;
if (Twain1.CapSet() == false)
MessageBox.Show("Failed to set the x-resolution.\r\n" + Twain1.ErrorString);
//Set YRESOLUTION current value.
Twain1.Capability = Dynamsoft.DotNet.TWAIN.Enums.TWCapability.ICAP_YRESOLUTION;
Twain1.CapType = Dynamsoft.DotNet.TWAIN.Enums.TWCapType.TWON_ONEVALUE;
Twain1.CapValue = 200;
if (Twain1.CapSet() == false)
MessageBox.Show("Failed to set the y-resolution.\r\n" + Twain1.ErrorString);
Twain1.AcquireImage();
8. How can I
upload acquired image to the Web server?
Dynamic .NET TWAIN supports FTP, HTTP Put and HTTP Post upload method.
The following is a http put method sample:
private void BeginScan()
{
Twain1.AcquireImage();
}
private void Twain1_OnPostTransfer()
{
if (Twain1.HTTPUploadThroughPut(
"127.0.0.1", 0, "httpUploadFileTemp.bmp") == false)
MessageBox.Show(Twain1.ErrorString);
}
9. How to use ADF? We want to save each document in
a separate file.
int iDocumentCounter = 0;
private void ADFScan()
{
iDocumentCounter = 0; //set initialize value
Twain1.OpenSource();
Twain1.IfShowUI = false;
Twain1.IfDisableSourceAfterAcquire = true;
if (Twain1.Duplex != Dynamsoft.DotNet.TWAIN.Enums.TWICapDuplex.TWDX_NONE)
Twain1.IfDuplexEnabled = true; //enable duplex
if (Twain1.IfFeederEnabled)
{
Twain1.XferCount = -1;
Twain1.IfAutoFeed = true; //auto feed
if (Twain1.IfFeederLoaded)
Twain1.AcquireImage();
}
}
private void Twain1_OnPostTransfer()
{
iDocumentCounter = iDocumentCounter + 1;
if (!Twain1.SaveAsBMP(@"c:\" + iDocumentCounter.ToString() + ".bmp", 0))
MessageBox.Show(Twain1.ErrorString);
}
10. How can I work with SSL?
You can use the IfSSL property.
Twain1.HTTPPort = 80;
Twain1.IfSSL = false; // if 80 is the port number of non-secure port
/*
Twain1.HTTPPort = 443;
Twain1.IfSSL = true; // if 443 is the port number of secure port
*/
Twain1.HTTPUploadThroughPost("127.0.0.1", 0, "/SaveToFile.php", "imageData.jpg");
if (Twain1.ErrorCode != Dynamsoft.DotNet.TWAIN.Enums.ErrorCode.Succeed)
MessageBox.Show(Twain1.ErrorString);
else //succeded
MessageBox.Show("Successful");
11. How can I add a new scanned image to an existed multi-page TIFF file?
private void Scan()
{
Twain1.AcquireImage();
}
private void Twain1_OnPostTransfer()
{
Twain1.CloseSource();
Twain1.IfTiffMultiPage = true;
Twain1.SaveAsTIFF (@"C:\SaveAsTIFF.tif", 0);
if (Twain1.ErrorCode != Dynamsoft.DotNet.TWAIN.Enums.ErrorCode.Succeed)
MessageBox.Show(Twain1.ErrorString);
else
MessageBox.Show("Successful");
}
12. How can I rotate an
image before I save it?
You can use the RotateLeft property and the RotateRight property.
private void Scan()
{
Twain1.AcquireImage();
}
private void RotateLeft()
{
Twain1.RotateLeft(0);
}
private void RotateRight()
{
Twain1.RotateRight(0);
}
private void Rotate()
{
Twain1.Rotate(0, 45.0, true,
Dynamsoft.DotNet.TWAIN.Enums.DWTInterpolationMethod.Bicubic);
}
Also, you can use the
ShowImageEditor method.
private void Scan()
{
Twain1.AcquireImage();
}
private void Twain1_OnPostTransfer()
{
Twain1.CloseSource();
Twain1.ShowImageEditor();
// You need to save the rotated image in the image editor before closing it
}
13. 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.
private void Next()
{
if (Twain1.HowManyImagesInBuffer == 0)
MessageBox.Show("There is no image in buffer");
Twain1.CurrentImageIndexInBuffer = (short)(Twain1.CurrentImageIndexInBuffer + 1);
}
private void Previous()
{
if (Twain1.HowManyImagesInBuffer == 0)
MessageBox.Show("There is no image in buffer");
Twain1.CurrentImageIndexInBuffer = (short)(Twain1.CurrentImageIndexInBuffer - 1);
}
14. How can I do a duplex scan?
private void DuplexScan()
{
Twain1.SelectSource();
Twain1.OpenSource();
Twain1.IfDuplexEnabled = true; //enable duplex
Twain1.XferCount = 2;
Twain1.MaxImagesInBuffer = 2;
Twain1.AcquireImage();
}
15. How can I scan an inverted
image?
You can use the PixelFlavor property.
private void Scan()
{
Twain1.PixelFlavor = TWICapPixelFlavor.TWPF_CHOCOLATE;
Twain1.AcquireImage();
}