Welcome

Thank you very much for choosing Dynamic Web TWAIN ActiveX 5.

If you do NOT want to read this documentation or spend any time in TWAIN, please click here.

The topics included in this Getting Started are:

What is Dynamic Web TWAIN ActiveX
TWAIN Overview
TWAIN State Transition
Benefits
Features
Edition Comparison
What's New
License Agreement
FAQ
Virtual Developer Service
Getting Supported
Distributing Dynamic Web TWAIN ActiveX

2007, Dynamsoft Corporation,
All the trademarks belong to their respective owners and are hereby acknowledged.


What is Dynamic Web TWAIN

What is Dynamic Web TWAIN ActiveX

Dynamic Web TWAIN ActiveX is a COM/ActiveX control which 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 V1.9. It has built-in TIFF, JPEG, PDF and PNG encoder and decoder. It supports all three image transfer modes and many other features.

With Dynamic TWAIN ActiveX control you can control any scanner, digital camera or capture card if it has a TWAIN driver. High-level acquisition support is provided for ease of use, and low-level functionality is provided for flexibility and control in even the most demanding applications.

Dynamic Web TWAIN ActiveX control has many features specifically designed for web environment, such as uploading and downloading images through FTP or HTTP protocol. Image can be displayed within Dynamic Web TWAIN directly, without exchanging image data between the ActiveX control and the <img> HTML tag, and the initial image can be downloaded from web server.


TWAIN Overview

TWAIN defines a standard software protocol and API (application programming interface) for communication between software applications and image acquisition devices (the source of the data).

The four key elements in TWAIN are:

  • The Application software - An application uses TWAIN protocol to acquire image or sound.
  • The Source Manager software - This software manages the interactions between the application and the Source. This code is provided by the TWAIN organization.
  • The Data Source software - TWAIN compliant hardware driver. This software is usually installed when the hardware driver is installed.
  • The Hardware.


TWAIN State Transition

Topics included in this article about TWAIN state are:

  • TWAIN State Transition
  • TWAIN State in Dynamic (Web) TWAIN ActiveX Control

    • TWAIN State Transition

    The application, Source Manager, and Source must communicate to manage the acquisition of data. It is logical that this process must occur in a particular sequence. For example, the application cannot successfully request the transfer of data from a Source before the Source Manager is loaded and prepared to carry out the request.

    To ensure the sequence is executed correctly, the TWAIN protocol defines seven states that exist in TWAIN sessions:

    TWAIN State in Dynamic (Web) TWAIN ActiveX Control

    Dynamic (Web) TWAIN ActiveX control greatly reduces the complexity of the standard TWAIN states.

    State 2 is removed. Calling OpenSourceManager() switches the state to State 3. Calling OpenSource() switches the state to State 4. Calling EnableSource() or AcquireImage() switches the state to State 5. State 6 and State 7 are hidden, just OnPreAllTransfers, OnPreTransfer, OnPostTransfer, PostAllTransfers, OnTransferError or OnTransferCancelled event will be fired.

    Furthermore, Dynamic (Web) TWAIN ActiveX control has built-in Wizard Mode. With this mode, the state transition is managed intelligently. You can simply forget the existence of the STATE. For example, if you call EnableSource() directly without calling OpenSource() , Dynamic (Web) TWAIN will call all the necessary functions to switch the TWAIN state to State 5. You can also exit a TWAIN application without calling CloseSource() or CloseSourceManager().


Benefits

Reach more customers
  • Compatible with Internet Explorer
  • Compatible with Netscape, Firefox and other browsers, if it supports plug-in.
  • Supports all 32-bit Windows operating system, including Windows 95, 98, ME, 2000, NT, XP, 2003 and Vista.
    •  Improved customer experience
  • Digitally signed by VeriSign.
  • Reduced web page load time. The size of distribution file is only 161k. It takes seconds to be downloaded and installed.
  • Reduced image upload time. Dynamic Wed TWAIN supports major compression methods, including JPEG, TIFF, PDF and PNG.
  • Improved customer confidence. Absolutely no local file operation required.
  • SSL image download/upload supported
  • Proxy supported. There is no need for customer to reconfigure their firewall.
    • Save $$ and time
  • Greatly reduced development time. The TWAIN 1.9 specification is 552 pages long. How many days will it take you even to read it? Not to mention building a TWAIN compatible application. If compression, for example PNG or JPEG, is involved, it will surely take you months of time to do it. With Dynamic Web TWAIN, most applications can be done with several lines of code.
  • Even more time saving. By using our Virtual Developer Service, the total time you need to spend in building your scanning solution could be reduced to only several hours.
  • $$ saving. Time saving means what? $$ of course.
    •  Other benefits
  • Improved product quality
  • Speeded up product delivery
    •


Features

  • Virtual Developer Service is provided. This service is designed to relieve you of any TWAIN related learning, development and maintenance. With this service, our developers participate in your TWAIN module development as a active team member.
  • Both ActiveX and Plug-In are supported. Compatible with Internet Explorer, Netscape, Firefox and many other browsers.
  • The ActiveX is digitally signed by VeriSign.
  • Multi acquired images can be buffered, viewed and managed locally before being uploaded to web server
  • Developed directly with pure Win32 API and assembly language, which make Dynamic Web TWAIN,
  • Small: no C/C++ run time library is used. Even with built-in JPEG, PNG, PDF, TIFF codec, the size of the CAB file is only 161K;
  • Fast: the core engine of the image processing part of the Dynamic Web TWAIN is optimized with assembly language;
  • Easy to distribute: absolutely no supporting DLL is needed for distributing.
  • TWAIN specification 1.9 compatible.
  • Provides an Image Editor for image editing and viewing
  • Both GUI and non-GUI editor are supported;
  • Supports basic image editing features including Rotate, Crop, Mirror, Flip and ChangeImageSize.
  • Supports BMP, JPEG, PNG, TIFF, PDF image formats
  • Supports RLE, G3, G4, LZW, PackBits TIFF compression
  • Supports HTML form fields operation
  • Supports upload progress bar and cancel during the upload
  • Supports image preview mode
  • Supports download from HTTP stream
  • Strong internet support: downloading and uploading image through HTTP or FTP.
  • Supports multi-page TIFF and PDF upload without any local file operation.
  • Marked safe for initializing and scripting.
  • Can be deployed in .NET environment as an unmanaged control.
  • Can be used in any COM-enlightened program language, such as C#, VB.NET, Visual C++, Visual Basic, Delphi, HTML/VBScript/JavaScript, PowerBuilder and so on.
  • Supports Native, Buffered Memory and Disk File image transfer modes.
  • Both single page and multi-page TIFF are supported.
  • Built-in wizard mode manages the states of the TWAIN session intelligently and makes the Dynamic Web TWAIN easy to use.
  • Built-in JPEG, PNG, PDF and TIFF encoder enables you to compress the acquired image no matter whether the TWAIN source has the capability.
  • Sample code provided: C#, VB.NET, VC, VB, Delphi, HTML (VBScript, JavaScript).
  • Supports auto document feeder (ADF) and multiple images acquisition.
  • Can set and read common device features through properties, such as: IfAutoFeed, IfAutoScan, Resolution, BitDepth, Brightness, Contrast, Unit, Duplex and so on.
    •


Edition Comparison

Features | Dynamic TWAIN 5 | Dynamic Web TWAIN 5 ActiveX | Dynamic Web TWAIN 5 Plug-in
TWAIN Support |  |  |
TWAIN Specification 1.9 Compatible |  |  |
Support Native Image Transfer Mode |  |  |
Support Buffered Memory Image Transfer Mode |  |  |
Support Disk File Image Transfer Mode |  |  |
Support Multiple Images Acquisition |  |  |
Support Multiple Frames Acquisition |  |  |
Support Automatic Document Feeder (ADF) |  |  |
Built-In TWAIN Session Wizard |  |  |
Can set and read common device features through properties, such as: IfAutoFeed, IfAutoScan, Resolution, BitDepth, Brightness, Contrast, Unit, Duplex and so on |  |  |
WEB |  |  |
Compatible with IE |  |  |
Compatible with Gecko-based browsers (such as Netscape, Firefox) |  |  |
Insertable in HTML |  |  |
Marked as Safe for Initializing and Scripting |  |  | N/A
Display Image in the Control |  |  |
Upload/download Image through HTTP and FTP |  |  |
Upload and Download Image through Proxy |  |  |
SSL upload and download |  |  |
Digital Signature |  |  |
Digital Signature |  |  |
Image Format |  |  |
JPEG |  |  |
Single Page and Multi-Page TIFF |  |  |
RLE, G3, G4, LZW, PackBits TIFF compression |  |  |
BMP |  |  |
PNG |  |  |
PDF |  |  |
Image Editor Features |  |  |
Rotate |  |  |
Crop |  |  |
Mirror |  |  |
Flip |  |  |
Change Image Size |  |  |
Multi-image buffer |  |  |
Multi-image buffer |  |  |
Support |  |  |
Free Support for Full License |  |  |
Free Support for Evaluation License |  |  |
Capability Negotiation |  |  |
Support TW_ONEVALUE Capability Container Type |  |  |
Support TW_ARRAY Capability Container Type |  |  |
Support TW_RANGE Capability Container Type |  |  |
Support TW_ENUMERATION Capability Container Type |  |  |
Support Get Capability Negotiation Operation Type |  |  |
Support GetCurrent Capability Negotiation Operation Type |  |  |
Support GetDefault Capability Negotiation Operation Type |  |  |
Support Reset Capability Negotiation Operation Type |  |  |
Virtual Developer Service |  |  |
Virtual Developer Service for Dynamic TWAIN |  |  |
Virtual Developer Service for Dynamic Web TWAIN |  |  |
Control/ActiveX/Plug-In |  |  |
Size (.cab/.XPI) | 95K | 161K | 161K
Absolutely No Supporting DLL is Needed for Distributing |  |  |
Accessible from Any COM-Enlightened Program Languages |  |  |
Deployable in .NET as an Unmanaged Control |  |  |
Sample Code |  |  |
Visual C++ 6.0 |  |  |
Visual Basic 6.0 |  |  |
Delphi 5.0 |  |  |
VB .NET |  |  |
C# .NET |  |  |
HTML |  |  |


What's New

5.0 (10/17/2007)

Summary:

  1. PDF and multi-page PDF support added. You can now save the scanned document to local disk or upload to web server in PDF format.
  2. HTML form manipulation support added. You can now add fields to the HTML form to have additional information for web server before uploading the scanned images to the web server.
  3. Image preview mode added. You can view the scanned images in the preview mode, like 1 by 2, 2 by 2. This feature helps you have better overview of your images when you have multi-page document.
  4. Image upload progress bar and cancel option added. You can use the built-in progress bar or your own progress bar for the upload. Cancel option is also provided.
  5. Download from HTTP stream support added. You do not need to create temp files at server side for download.
  6. More user interaction features added. Several mouse events are added.
  7. Other minor fixes and tweaks.

Details:

  •   Added methods:
SetViewMode(),
    GetViewMode(),
                            SaveAsPDF(),
                            SaveAllAsPDF(),

                            FTPUploadAllAsPDF(),

                            HTTPUploadAllThroughPostAsPD F(),

                            HTTPUploadAllThroughPutAsPD F(),
                            LoadImageEx(),
                            FTPDownloadEx(),
                            FTPUploadE x(),
    HTTPDownloadE x(),

                            HTTPUploadThroughPostE x(),

                            HTTPUploadThroughPutE x(),
    SetHTTPFormField(),
    ClearAllHTTPFormFiled()

  • Added properties:
    ImageMargin, MouseShape, PDFCompressionType, PDFAuthor, PDFCreationDate, PDFCreator, PDFKeywords, PDFModifiedDate, PDFProducer, PDFSubject, PDFTitle, IfShowCancelDialogWhenImageTransfer

  • Added events:
    OnMouseClick, OnMouseMove, OnInternetTransferPercentage

4.2.1 (4/28/2006)

  • Fixed bug where uploading or downloading images via SSL connection fails sometimes
  • IfSSL property added

4.2 (11/01/2005)

  • Dynamic Web TWAIN ActiveX is digitally signed by VeriSign

4.1 (9/08/2005)

  • Image Editor added. Can be used for image editing and viewing. Supports basic image editing features including Rotate, Crop, Mirror, Flip and ChangeImageSize.

    Added methods for Image Editor:
    RotateLeft(), RotateRight(), Mirror(), Crop(), CropToClipboard(), GetImageSize(), ChangeImageSize(), ShowImageEditor()

    • Added properties for Image Editor:
    ImageEditorWindowTitle, ImageEditorIfReadonly, ImageEditorIfEnableEnumerator
  • Other methods added:
  LoadDibFromClipboard(),
  GetDefaultImageLayout(),
  GetImageLayout(),
  ResetImageLayout(), SetImageLayout()

4.0 (5/31/2005)

Overview:
  • Plug-In Edition added. Compatible with Netscape, FireFox and other Gecko-based browsers.
  • PNG supported
  • RLE, G3, G4, LZW, PackBits TIFF compression supported
  • Local multi-image buffer added: you can view and manage multiple acquired images locally before uploading them to web server
  • Multi-page TIFF upload/download supported

Technical details:

  •   Added methods:
SaveAllAsMultiPageTIFF(),
  SaveAsPNG(),
  RemoveAllImages(),
  RemoveImage(),
  FTPUpload(),
  FTPDownload(),
  HTTPUploadThroughPost(),
  HTTPUploadThroughPut(),
  HTTPDownload(),
HTTPUploadAllThroughPostAsMultiPageTIFF(),
HTTPUploadAllThroughPutAsMultiPageTIFF(),
FTPUploadAllAsMultiPageTIFF()
  • Added properties:
    MaxImagesInBuffer, HowManyImagesInBuffer, CurrentImageIndexInBuffer, TIFFCompressionType, IfFitWindow
  • SaveAsBMP(),
SaveAsJPEG() and
SaveAsTIFF()  methods modified. They now save
images of specified indexes in buffer.
  • CopyToClipboard() method modified. It copies the image of a specified index in buffer
  • CutToClipboard() method modified. It cuts the image of a specified index in buffer
  • The behavior of hDIB property changed. It returns the Handle of the DIB of a specified index in buffer
  • The behavior of Picture property changed. It returns the Picture object of the image of a specified index in buffer
  • FTPUploadAsBMP(), FTPUploadAsJPEG(), FTPUploadAsTIFF() methods replaced by FTPUPload() method
  • FTPDownloadBMP() and FTPDownloadJPEG() methods replaced by FTPDownload() method
  • HTTPUploadAsBMPThroughPost(), HTTPUploadAsJPEGThroughPost() and HTTPUploadAsTIFFThroughPost() methods replaced by HTTPUploadThroughPost() method
  • HTTPUploadAsBMPThroughPut(), HTTPUploadAsJPEGThroughPut() and HTTPUploadAsTIFFThroughPut() methods replaced by HTTPUploadThroughPut() method
  • HTTPDownloadBMP() and HTTPDownloadJPEG() methods replaced by HTTPDownload() method
  • LoadBMP() and LoadJPEG() methods replaced by LoadImage() method

3.0.3 (3/15/2005)

  • HTTPPostResponseString property added. Response string from the HTTP server will be available in HTTPPostResponseString property if an error occurs for HTTPUploadAsBMPThroughPost(), HTTPUploadAsJPEGThroughPost() and HTTPUploadAsTIFFThroughPost() methods

3.0.2 (3/7/2005)

  • HTTPUploadAsBMPThroughPost(), HTTPUploadAsJPEGThroughPost() and HTTPUploadAsTIFFThroughPost() methods memory access violation bug fixed

3.0.1 (2/24/2005)

  • Revised documentation
  • Duplex property can work properly now
  • The behavior of IfTiffMultiPage property changed. If IfTiffMultiPage is TRUE, a Tiff file will be created if the specific file doesn't exist
  • Detailed error information will be available in ErrorString property if an error occurs for HTTPUploadAsBMPThroughPost(), HTTPUploadAsJPEGThroughPost() and HTTPUploadAsTIFFThroughPost() methods

3.0 (1/18/2005)

  • One page and multi-page Tiff supported
  • HTTPUpload now supports HTTP Post command
  • Many high level properties and methods added
  • Method EnableSource(Boolean IfShowUI)  changed to
  EnableSource(), method
  HTTPUploadAsBMP()  changed to HTTPUploadAsBMPThroughPut(),
  method HTTPUploadAsJPEG()  changed to HTTPUploadAsJPEGThroughPut().
  • Added methods:
FeedPage(), FTPUploadAsTIFF(),
  RewindPage()
HTTPUploadAsBMPThroughPost(), HTTPUploadAsJPEGThroughPost(),
HTTPUploadAsTIFFThroughPost(), HTTPUploadAsTIFFThroughPut(),
  SaveAsTIFF()
  • Added properties:
    BitDepth Brightness Contrast DataSourceStatus
    Duplex IfAutoBright IfAutoFeed IfAutoScan
    IfDeviceOnline IfDisableSourceAfterAcquire IfDuplexEnabled IfFeederEnabled
    IfModalUI IfPaperDetectable IfShowIndicator IfShowUI
    IfThrowException IfTiffMultiPage IfUIControllable PageSize
    PixelFlavor PixelType Resolution Unit
    XferCount

2.01 (12/21/2004)

  • HTTPUploadAsJPEG() and HTTPUploadAsBMP() modified to accommodate the new behavior of the IIS of Windows 2003 Server

2.0 (6/1/2004)

  • The online demo is available
  • Supports uploading and downloading through HTTP
  • Supports proxy
  • Built-In JPEG codec
  • Supports Buffered Memory image transfer mode
  • Supports Disk File image transfer mode
  • Totally rewritten with pure Windows API and assembly language
  • Built-In TWAIN session wizard
  • CapSetFrame(), CapGetFrameLeft(), CapGetFrameTop(), CapGetFrameRight(), CapGetFrameBottom() added for the negotiation of ICAP_FRAMES capability
  • OnPreAllTransfers, OnPostAllTransfers, OnTransferCancelled, OnTransferError events added

1.02 (3/15/2004)

  • BorderStyle property added

1.01 (11/15/2003)

  • hDIB property added
  • Picture property can work properly

1.0 (8/20/2003)

  • TWAIN specification 1.9 compatible
  • Supports Native image transfer mode
  • Supports uploading and downloading image trough FTP


License Agreement

IMPORTANT: PLEASE READ CAREFULLY.

THE USE OF THIS SOFTWARE IS SUBJECT TO THE TERMS OF THE LICENSE AGREEMENT PRINTED BELOW. IF YOU DO NOT AGREE WITH ANY OF THE TERMS, THEN YOU SHOULD NOT USE THE SOFTWARE OR ANY PART OF THE SOFTWARE IN ANY WAY. BY USING THIS PRODUCT, YOU AGREE TO BE BOUND BY ALL THE TERMS AND CONDITIONS OF THIS LICENSE AGREEMENT.

THE AGREEMENT

This document is a legal agreement between Dynamsoft Corporation., Canada, hereafter referred to as "Dynamsoft" and the user of the software herein referred to as "You".

DEFINITIONS

"SOFTWARE" means the software known as "Dynamic Web TWAIN ActiveX Control" and all its components, parts and documentation, which have been developed by Dynamsoft.

GRANT OF LIMITED LICENSE

I. EVALUATION LICENSE

Dynamsoft grants you a limited, non-exclusive, non-transferable, personal license to use the SOFTWARE for evaluation purposes only for 30 days. The license does not permit the development and distribution of any applications using the SOFTWARE. You may not distribute any part of the SOFTWARE.

II. DEVELOPER LICENSE

With developer license, you may not deploy the SOFTWARE on web server, including internet and intranet server.

Dynamsoft grants you a limited, not-exclusive, non-transferable license to user the SOFTWARE and the accompanying materials for the purpose of development. You can distribute non-web applications that use Dynamic Web TWAIN as a runtime component royalty free.

Only the DynamicWebTwainCtrl.dll can be distributable. No other files supplied with the SOFTWARE may be distributed with the non-web application.

With one Developer License, only one developer can use the SOFTWARE for development purpose.

III. WEB SERVER LICENSE

You may not use the Web Server License for development purpose.

Dynamsoft grants you a limited, not-exclusive, non-transferable license to deploy the SOFTWARE on web server. You may use <OBJECT> tag with CODEBASE parameter for the SOFTWARE in HTML.

With one Web Server License, you can deploy the SOFTWARE on only one web server.

RESTRICTIONS

You must NOT distribute the DynamicWebTWAINActiveX5.lic file under any circumstances.

Your product is targeted to end users. The end user application must not be another development tool (such as ActiveX control) designed to be used for creating other end user applications using the SOFTWARE.

A user of any end user applications may not further use parts of the SOFTWARE for software development, copying or distribution. You must enforce this in a separate agreement with the user of any end user applications.

For Evaluation License and Developer License, you may use only one copy of the SOFTWARE at any time for each license. The SOFTWARE is "in-use" on a computer when it is loaded into temporary memory (i.e. RAM) or installed into the storage device of that computer.

You may make a single copy of the SOFTWARE for backup purposes only.

You are not allowed to expose directly or indirectly the properties and methods of the SOFTWARE.

All rights reserved. You may not use, copy, modify, reverse engineer, decompile, disassemble, sell, transfer, hire, lend or otherwise distribute the SOFTWARE or any accompanying materials in whole or in part, except as expressly provided for in this agreement.

OWNERSHIP

Dynamsoft shall remain the owner of the SOFTWARE.

This license does not confer any ownership rights to the licensee.

WARRANTIES AND DISCLAIMERS

THIS SOFTWARE AND THE ACCOMPANYING FILES ARE SOLD "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ANY USE BY YOU OF THE SOFTWARE IS AT YOUR OWN RISK.

NO LIABILITY FOR CONSEQUENTIAL DAMAGES. UNDER NO CIRCUMSTANCE SHALL DYNAMSOFT BE RELIABLE FOR ANY DAMAGES WHATSOEVER ARISING FROM THE USING OR INABILITY TO USE DYNAMSOFT PRODUCT.

APPLICABLE LAW

This agreement shall be governed by the laws of Canada.


Dynamic Web TWAIN FAQ General Questions

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?

  • 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 TWAIN family products is TWAINsupport@dynamsoft.com.
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.

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

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

  • With the Virtual Developer Service, we can be involved in your project as much as needed. We take part in your project from requirement analysis to completion.
  • With the Virtual Developer Service, we communicate with you closely, analyze your requirements, propose tech solutions, 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.

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?

  • The CAB file can be found in the installation directory of Dynamic Web TWAIN ActiveX.
  • The XPI file can be found in the installation directory of Dynamic Web TWAIN Plug-in.
  • The LPK file can be created by Lpk_tool.exe that can be downloaded from www.microsoft.com.

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.

  • Install the Dynamic Web TWAIN on Windows.
  • Place the CAB file and the LPK file into the directory of Web server 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:

  • Uninstall the Trial version of Dynamic Web TWAIN from your machine.
  • Install the Full version of Dynamic Web TWAIN to your machine.
  • Input the Web Server License you purchased into the Licensing Tool.
  • Change the Class ID from Trial version to Full version.
    For the information about the Class ID of Trial version and Full version, please refer to Deploying Dynamic Web TWAIN on Web Server.
  • Recreate a LPK file with the Web Server License you have purchased.

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?

  • Developer License: Developer License is for development. Every developer working on TWAIN programming needs a Developer License. For example, if you have 3 developers working on Dynamic Web TWAIN, you need 3 Developer licenses.
  • Web Server License: Web Server License is for Web server deployment. Every Web server deployment needs a Web Server License. For example, if you have 3 developers and 10 Web servers to deploy on, you need 3 Developer licenses and 10 Web Server Licenses.

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 property and the RotateRight property.

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.

  • Please refer to the following code.

<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>
      <p>
      <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>
      </p>
   </BODY>
</HTML>
  • Place the 'DynamicWebTwain.xpi' file (where to find the 'DynamicWebTwain.xpi' file) in the same directory of your page.
  • Click the 'Install Missing Plugins' button. Firefox displays a message indicating it couldn't find any suitable plugins. Then click the 'Manual Install' button.
  • Select to open the 'DynamicWebTwain.xpi' file with 'firefox.exe' and click 'OK'.
  • Click 'Install Now'.
  • Refresh your page.

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.

  • Find the 'dclusr.dpk' file in the "Lib" folder under the installation directory of Delphi and then open it with Delphi.
  • Right click the "DYNAMICWEBTWAINCTRLLib_TLB.dcr" file and select "Remove Form Project". Also, do the same operation to the "DYNAMICWEBTWAINCTRLLib_TLB.pas" file.
  • Click the "Compile" icon.
  • Save the 'dclusr.dpk' file before closing it.

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.


Virtual Developer Service

Dynamic Web TWAIN Virtual Developer Service

In relative terms, TWAIN is a special area which needs special expertise and knowledge.

To truly relieve you of any efforts in TWAIN related learning, designing, coding and debugging, we proudly announce our Virtual Developer Service.

With this service, our developers participate in your web scanning module as an active team member from requirement analysis, design, coding, testing deployment to maintenance.
Virtual Developer Service for Dynamic Web TWAIN
  • Top priority of request response.
  • We take care of all the TWAIN related development for your project, including requirement analysis, design, coding, testing, deployment and maintenance
  • 100% Satisfaction guaranteed. One month unconditional money back guarantee.
  • The available techniques are: VB, VC, VB.NET, C#, Delphi, C++ Builder, ADO, DAO, Access, SQL Server.
For web application, the available techniques are: ASP/ASP.NET + ADO + SQL Server, PHP + MySQL, Java, VBScript, JavaScript, Multi-Tier Architecture.
What are the major differences between the Virtual Service and standard customer support?
  • With the Virtual Developer Service, we can be involved in your project as much as needed. We take part in your project from requirement analysis to completion.
  • With the Virtual Developer Service, we communicate with you closely, analyze your requirements, propose tech solutions, 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.
Conditions and Terms

The following conditions and terms apply to our Virtual Developer Service. By using the service, you agree to be bound by them.

  • Although we try our best to provide accurate service, we are not responsible for errors that may occur. Under no circumstances, Dynamsoft should be responsible for any damages caused by our service. You agree to use our service at your own risk.
  • With the Virtual Developer Service, all the features must be directly TWAIN related and can be implemented with Dynamic TWAIN or Dynamic Web TWAIN.
  • Only code is provided. No documentation will be provided.
  • Dynamsoft agrees to keep all the communication between Dynamsoft and you confidential.
  • You agree to keep all the communication between Dynamsoft and you confidential.
Dynamsoft reserves the right to not carry out the Virtual Developer Service at Dynamsoft’s discretion. If we decide not to carry out the Virtual Developer Service, we refund you the full service fee.


Getting Supported

DynamicTWAIN.com, a division of 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.

Email is selected as the main means of support, since code can be exchanged easily in email and service quality can be ensured by monitoring.

Our email address for TWAIN family products is TWAINsupport@dynamsoft.com.

You can also get supported from DynamicTWAIN Support Forum. It is a tech support forum community where members of this community can come to discuss and get help with all issues related to TWAIN family products. Our support forum URL is http://forum.dynamictwain.com/dynamictwainforum/index.php.


Distributing Dynamic Web TWAIN

Distributing Dynamic Web TWAIN ActiveX

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

YOU MUST NOT DISTRIBUTE DynamicWebTWAINActiveX5.lic.

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. JPEG codec is the built-in feature of Dynamic Web TWAIN and no additional DLL is needed either.

Please refer to the License Agreement for more info.


Programmer Guide

This section, along with sample applications, provides programmers with guide of mastering Dynamic Web TWAIN. The sample applications are installed with Dynamic Web TWAIN and can be found from the Start Menu.

The topics included in this subheading are:

The "Hello World" Sample
The Data Type Mapping between COM Object, VB, C/C++ and Delphi
Deploying Dynamic Web TWAIN on Web Server
Using Dynamic Web TWAIN in Different Development Environments
Capability Negotiation

If you do NOT want to read this documentation or spend any time in TWAIN, please click here.


The "Hello World" sample

The purpose of this sample is to provide the basic idea about what the Dynamic Web TWAIN ActiveX Control looks like.

  1. Start the Microsoft Visual Basic 6. Create a "Standard EXE" application.
  2. From the "Project" menu, click "Component".
  3. In the "Components" dialog box, check "Dynamic Web TWAIN V4.0 By Dynamsoft". Click "Ok" to close the dialog box.
  4. Add a CommandButton Control to the form. Change the Caption Property to "Acquire". Change the Name Property to "btnAcquire".
  5. Add a Dynamic Web TWAIN Control to the form. Change the BorderStyle Property to "Single3D". Resize the control.
  6. Add the following code:
    VB Sample:
     Private Sub btnAcquire_Click()
     DynamicWebTwain1.AcquireImage
 End Sub
  7. Run the application. After acquiring an image from a source, it should be like this:

Remarks

  1. From this simple sample, we can see the power of the Dynamic Web TWAIN. Just with one line of code, an image can be acquired from a source and displayed in a form.
  2. With the built-in Wizard Mode, which handles the TWAIN state transition intelligently, the single line of AcquireImage makes the default data source to be ready for image acquiring.

  3. During the acquiring process, the OnPreAllTransfers Event, OnPreTransfer Event, OnPostTransfer Event and OnPostAllTransfers Event are triggered. In this sample, we do not need to handle any of them.

  4. The similar samples are available in Visual C++, Visual Basic, Delphi, C# and VB.NET. The name of the sample is TheMinimumSystem.


COM Data Type Mapping

In order to make Dynamic (Web) TWAIN accessable from any COM-enlightened program languages, such as VC, VB, Delphi and VBScript, only variant compliant IDL data types are used in the Dynamic (Web) TWAIN interface.

The following table is the mapping between different languages:

COM Type | Visual Basic Mapping | Java(J++) Mapping | C/C++ Mapping | Delphi Mapping | C# .NET Mapping | VB .NET Mapping
VARIANT_BOOL | Boolean | boolean | VARIANT_BOOL | WordBool | bool | Boolean
double | Double | double | double | Double | double | Double
float | Single | float | float | Single | float | Single
long | Long | int | long | Integer | int | Integer
short | Integer | short | short | SmallInt | short | Short
BSTR | String | java.lang.String | BSTR | WideString | string | String
DATE | Date | double | DATE | TDateTime | System.DateTime | Date
IDispatch* | Object | java.lang.Object | IDispatch* | IDispatch | Dispatch | Object
IUnknow* | Interface reference | com.ms.com.Variant | VARIANT | IUnknown | object | Object
VARIANT | Variant | com.ms.com.Variant | VARIANT | OleVariant | object | Object
CY/CURRENCY | Currency | long | CY/CURRENCY | Currency | decimal | Decimal

Out of the consideration of convenience, the Visual Basic data types are chosen to present the data types in this document. Using the preceding table, the VB data type can be easily mapped to C++, Delphi, C#.NET and VB.NET.

For other programming languages, please consult the accompanying document. Dynamic (Web) TWAIN is designed to be used in any COM compatible development environments.


Deploying Dynamic Web TWAIN on Web Server

Important: 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.

The followings are the steps needed to deploy Dynamic Web TWAIN on web server:

  1. Run Lpk_tool.exe on a computer that is licensed to use Dynamic Web TWAIN.
    Note: Lpk_tool.exe can be downloaded from www.microsoft.com.
  2. Highlight DynamicWebTwain Class, and then click Add.

  3. Click Save & Exit, and then type DynamicWebTwain.lpk for the LPK file.
  4. In the HTML page, insert an <OBJECT> tag for the License Manager object before any other <OBJECT> tags. The License Manager is an ActiveX control that is installed with Internet Explorer.

<OBJECT CLASSID = "clsid:5220cb21-c88d-11cf-b347-00aa00a28331" VIEWASTEXT>
    <PARAM NAME="LPKPath" VALUE="DynamicWebTwain.lpk">
</OBJECT>

    Note: This CLASSID, "5220cb21-c88d-11cf-b347-00aa00a28331", is for the License Manager and not for your ActiveX controls. You must use the same CLASSID every time you refer to the LPK file. In addition, you should keep the Name property of the <PARAM> tag as "LPKPath", and set the Value property for the <PARAM> tag of the License Manager object to the LPK file name and path.
  5. The signed CAB file "DynamicWebTWAIN.cab" is in the installation directory of Dynamic Web TWAIN.
  6. Insert a <OBJECT> tag for Dynamic Web TWAIN.

    For trial version of Dynamic Web TWAIN:

<object classid="clsid:FFC6F181-A5CF-4ec4-A441-093D7134FBF2" id="DynamicWebTwain1" width="143" height="156"
CodeBase = "DynamicWebTWAIN.cab#version=4,2,1">
<param name="_cx" value="847">
<param name="_cy" value="847">
<param name="JpgQuality" value="80">
<param name="Manufacturer" value="DynamSoft Corporation">
<param name="ProductFamily" value="Dynamic Web TWAIN">
<param name="ProductName" value="Dynamic Web TWAIN">
<param name="VersionInfo" value="Dynamic Web TWAIN 4.2.1">
<param name="TransferMode" value="0">
<param name="BorderStyle" value="0">
<param name="FTPUserName" value>
<param name="FTPPassword" value>
<param name="FTPPort" value="21">
<param name="HTTPUserName" value>
<param name="HTTPPassword" value>
<param name="HTTPPort" value="80">
<param name="ProxyServer" value>
<param name="IfDisableSourceAfterAcquire" value="0">
<param name="IfShowUI" value="1">
<param name="IfModalUI" value="1">
<param name="IfTiffMultiPage" value="0">
<param name="IfThrowException" value="0">
<param name="MaxImagesInBuffer" value="1">
<param name="TIFFCompressionType" value="0">
</object>

For full version of Dynamic Web TWAIN:

<object classid="clsid:E7DA7F8D-27AB-4EE9-8FC0-3FEC9ECFE758" id="DynamicWebTwain1" width="143" height="156"
CodeBase = "DynamicWebTWAIN.cab#version=4,2,1">
<param name="_cx" value="847">
<param name="_cy" value="847">
<param name="JpgQuality" value="80">
<param name="Manufacturer" value="DynamSoft Corporation">
<param name="ProductFamily" value="Dynamic Web TWAIN">
<param name="ProductName" value="Dynamic Web TWAIN">
<param name="VersionInfo" value="Dynamic Web TWAIN 4.2.1">
<param name="TransferMode" value="0">
<param name="BorderStyle" value="0">
<param name="FTPUserName" value>
<param name="FTPPassword" value>
<param name="FTPPort" value="21">
<param name="HTTPUserName" value>
<param name="HTTPPassword" value>
<param name="HTTPPort" value="80">
<param name="ProxyServer" value>
<param name="IfDisableSourceAfterAcquire" value="0">
<param name="IfShowUI" value="1">
<param name="IfModalUI" value="1">
<param name="IfTiffMultiPage" value="0">
<param name="IfThrowException" value="0">
<param name="MaxImagesInBuffer" value="1">
<param name="TIFFCompressionType" value="0">
</object>


Using Dynamic Web TWAIN in Different Development Environments

Dynamic Web TWAIN is a standard COM control. It can be used in any COM compatible environments.

Topics about how to use Dynamic Web TWAIN in different development environments are:

Using Dynamic Web TWAIN in Microsoft Visual Basic 6
Using Dynamic Web TWAIN in Microsoft Visual C++
Using Dynamic Web TWAIN in Borland Delphi
Using Dynamic Web TWAIN in Microsoft Visual Studio .NET


Using Dynamic Web TWAIN in Microsoft Visual Basic 6

The following shows the steps of using Dynamic Web TWAIN in Microsoft Visual Basic 6.

  1. Start Visual Basic 6.
  2. In the New Project dialog box, click Open to new a Standard EXE project.
  3. On the Project menu, click Component to display the Dynamic Web TWAIN dialog box.
  4. Click the check box on the left of Dynamic Web TWAIN name to select Dynamic Web TWAIN, as seen in the following figure.
  5. Click OK to close the Dynamic Web TWAIN dialog box. The Dynamic Web TWAIN will now appear in the Toolbox, as seen in the following figure.
  6. From this point on, you can use Dynamic Web TWAIN in the same way as any other controls in Visual Basic.


Using Dynamic Web TWAIN in Microsoft Visual C++ 6

Microsoft Visual C++ 6 is COM enabled. In dialog based MFC applications, you can use Dynamic Web TWAIN "visually" in the IDE. In non-dialog based MFC applications, such as MDI or SDI applications, you need to write code to add the Dynamic Web TWAIN to your applications.

The topics about how to use Dynamic Web TWAIN in these two different kinds of application are:

Using Dynamic Web TWAIN in Microsoft Visual C++ Dialog Based Applications
Using Dynamic Web TWAIN in Microsoft Visual C++ Non-Dialog Based Applications


Using Dynamic Web TWAIN in Visual C++ Dialog Based Applications

Topics included in this article that describe how to use Dynamic Web TWAIN in Visual C++ dialog based applications are:

  • 1. Adding Dynamic Web TWAIN to a Visual C++ Project
  • 2. Adding a Member Variable Associated with Dynamic Web TWAIN
  • 3. Adding an Event Handler
    •

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

    1. Start Micorosoft Visual C++.
    2. On the File menu, click New to bring up the New dialog box.
    3. In the New dialog box, select MFC AppWizard (exe) project type and input DynamicWebTwainDlgApp in the Project Name edit box, as seen in the following figure.
    4. Click OK button.
    5. In the MFC AppWizard - Step 1 dialog box, select Dialog based application type and click Finish button.
    6. In the New Project Information dialog box, click OK button.
    7. On the Project menu, point to Add To Project, then click Components and Controls.
    8. In the Components and Controls Gallery dialog box , expand the Registered ActiveX Controls folder, select the DynamicWebTwain Class, click Insert.
    9. In the Microsoft Visual C++ dialog box, click OK.
    10. In the Confirm Classes dialog box, click OK.
    11. In the Components and Controls Gallery dialog box, click Close to close the dialog box.
    12. DynamicWebTwain control will now appear in the Visual C++ dialog editor Toolbox, as seen in the following figure:
    13. From this point on, you can use Dynamic Web TWAIN in the same way as other controls.
    14. So far, Dynamic Web TWAIN ActiveX Control has been imported into DynamicWebTwainDlgApp project, and a wrapper class called CDynamicWebTwain has been generated by Visual C++ IDE, as seen in the following figure:

    2. Adding a Member Variable Associated with Dynamic Web TWAIN

    1. Place a Dynamic Web TWAIN control in a dialog.
    2. Press Ctrl-W to invoke MFC ClassWizard.
    3. In the MFC ClassWizard dialog box, click Member Variables tab, as seen in the following figure:
    4. In the MFC ClassWizard dialog box, click Add Variable button.
    5. In the Add Member Variable dialog box, input m_DynamicWebTwain (or other name) in the Member Variable Name edit box, click OK.
    6. From this point on, you can call the member functions of the m_DynamicWebTwain to communicate with the ActiveX Control. Every property or method in Dynamic Web TWAIN ActiveX Control has corresponding function in m_DynamicWebTwain.

    3. Adding an Event Handler

    1. In the MFC AppWizard dialog box, click Message Maps tab. In this page, all the Events of Dynamic Web TWAIN are listed, as seen in the following figure:
    2. You can select the event you want to handle, such as OnPostTransfer, then click Add Function to add an event handler.
    3. In the Add Member Function dialog box, click OK.
    4. Add code in the event handling function.


Using Dynamic Web TWAIN in Visual C++ Non-Dialog Based Applications (SDI, MDI)

Topics included in this article that describe how to use Dynamic Web TWAIN in Visual C++ non-dialog based applications are:

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

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

    1. Start Microsoft Visual C++.
    2. On the File menu, click New to bring up the New dialog box.
    3. In the New dialog box, select MFC AppWizard (exe) project type and input DynamicWebTwainNonDlgApp in the Project Name edit box, as seen in the following figure.
    4. Click OK button.
    5. In the MFC AppWizard - Step 1 dialog box, select Single document application type and click Finish button.
    6. In the New Project Information dialog box, click OK button.
    7. On the Project menu, point to Add To Project, then click Components and Controls.
    8. In the Components and Controls Gallery dialog box , expand the Registered ActiveX Controls folder, select the DynamicWebTwain Class, click Insert.
    9. In the Microsoft Visual C++ dialog box, click OK.
    10. In the Confirm Classes dialog box, click OK.
    11. In the Components and Controls Gallery dialog box, click Close to close the dialog box.
    12. So far, Dynamic Web TWAIN ActiveX Control has been imported into DynamicWebTwainNonDlgApp project, and a wrapper class called CDynamicWebTwain has been generated by Visual C++ IDE, as seen in the following figure:

    2. Adding Code to The Project

    1. On the View menu, click Resource Symbols. In the Resource Symbols dialog box, click New button. In the New Symbol dialog box, input ID_DYNAMICWEBTWAIN in the Name edit box, click OK. Click Close.
    2. In the DynamicWebTwainNonDlgAppView.h file, add #include "DynamicWebTwain.h" just before the CDynamicWebTwainNonDlgAppView class definition.

#include "DynamicWebTwain.h"
class CDynamicWebTwainNonDlgAppView : public CView

    3. Add a member variable m_DynamicWebTwain to the private section of the CDynamicWebTwainNonDlgAppView class definition.

class CDynamicWebTwainNonDlgAppView : public CView
{
private:
    CDynamicWebTwain m_DynamicWebTwain;

    4. Add DECLARE_EVENTSINK_MAP() after DECLARE_MESSAGE_MAP() in the DynamicWebTwainNonDlgAppView.h.

DECLARE_MESSAGE_MAP()

DECLARE_EVENTSINK_MAP()

    5. Add a WM_CREATE message handler to class CDynamicWebTwainNonDlgAppView. Edit the function as the following:

int CDynamicWebTwainNonDlgAppView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    if (CView::OnCreate(lpCreateStruct) == -1)
        return -1;

    if (m_DynamicWebTwain.Create(NULL,NULL,NULL,CRect(1,1,2,2),this,ID_DYNAMICWEBTWAIN,NULL) == FALSE)
        return -1;

    m_DynamicWebTwain.AcquireImage();

    return 0;
}

      m_DynamicWebTwain.Create() is to create the ActiveX control.
      m_DynamicWebTwain.AcquireImage() is to start the image acquiring process. This is for demonstrating the event handler only. In really application, it may be more reasonable to add a menu item to start the acquiring.
    6. Add event sink map after message map in DynamicWebTwainNonDlgAppView.cpp.

END_MESSAGE_MAP()

BEGIN_EVENTSINK_MAP(CDynamicWebTwainNonDlgAppView, CView)
    ON_EVENT(CDynamicWebTwainNonDlgAppView,ID_DYNAMICWEBTWAIN,1,OnPostTransferHandler,VTS_NONE)
END_EVENTSINK_MAP()

      1 is the Dispatch ID of the OnPostTranfer event. OnPostTransferHandler is a private member function of CDynamicWebTwainNonDlgAppView class to handler the event. VTS_NONE indicates the event passes no arguments.
    7. Add a private member function OnPostTransferHandler to handle the event.

void CDynamicWebTwainNonDlgAppView::OnPostTransferHandler()
{
    MessageBox("OnPostTransfer event fired.");
}


Using Dynamic Web TWAIN in Borland Delphi

Before opening the accompanied sample applications written in Delphi, please import the Dynamic Web TWAIN into Delphi first. The sample applications are installed with Dynamic Web TWAIN and can be found from the Start Menu.

The following shows the steps of using Dynamic Web TWAIN in Borland Delphi 5. For other versions of Delphi, the steps should be similar.

  1. Start Delphi 5.
  2. On the Component menu, click Import ActiveX Control to display the Import ActiveX dialog box.
  3. In the list box of Import ActiveX dialog box, select Dynamic Web TWAIN. Click Install.
  4. In the Install dialog box, click OK.
  5. In the Confirm dialog box, click Yes.
  6. In the Information dialog box, click OK.
  7. The Dynamic Web TWAIN is added to Delphi Toolbox, as seen in the following figure.
  8. From this point on, you can use Dynamic Web TWAIN in the same way as any other controls in Delphi.


Using Dynamic Web TWAIN in Microsoft Visual Studio .NET

Before opening the accompanied sample applications written in C# and VB.NET, please import the Dynamic Web TWAIN into Visual Studio .NET first. The sample applications are installed with Dynamic Web TWAIN and can be found from the Start Menu.

Microsoft .NET Framework offers a highly productive multi-language environment for developers. In .NET framework, the languages are compiled into Microsoft Intermediate Language (MSIL) output according to the common language specification. In run-time, the intermediate code will be compiled into machine code and then run against the Common Language Runtime.

Under this mechanism, the performance of applications suffers significantly, especially for the image processing applications, like Dynamic Web TWAIN. Dynamic Web TWAIN is developed directly from system API and assembly language to get high performance.

To enable our customers to be able to use Dynamic Web TWAIN in .NET without sacrificing the high-performance of Dynamic Web TWAIN, our policy of Dynamic Web TWAIN in .NET is to take advantage of the interoperability feature of .NET.

The interoperability feature of the Microsoft .NET Framework enables developers to continue using traditional Active Server Pages, Component Object Model applications, and Microsoft Win32 DLLs, making it easier to choose if and when to migrate existing managed code to .NET.

The followings are the steps of importing Dynamic Web TWAIN into .NET. We can see how easy it is.

  1. Start Visual Studio .NET.
  2. From the Tools menu, select Add/Remove Toolbox Items.
  3. In the Customize ToolBox dialog box, check the DynamicWebTwain Class. Click OK to close the dialog box.
  4. From now on, the Dynamic Web TWAIN ActiveX Control can be used in .NET like other controls.


Capability Negotiation

The following topics are discussed in this sub heading:

Why Capability Negotiation

What You can Do with Capability Negotiation

Capability Container Types

Capability Negotiation Operation Types

How to Negotiate Capability with Different Capability Container Types

How to Negotiate ICAP_FRAMES


Why Capability Negotiation and The Usage of Capability Negotiation

Why Capability Negotiation

One of TWAIN's benefits is that it allows applications to easily interact with a variety of acquisition devices.

Different devices may have different capabilities. For instance,

  • Some devices have automatic document feeders.
  • Some devices are not limited to one image but can transfer multiple images.
  • Some devices support color images.
  • Some devices offer a variety of halftone patterns.
  • Some devices support a range of resolutions while others may offer different choices.
    •  With capability negotiation, developers can make applications act accordingly.


What You Can Do with Capability Negotiation

Developers of applications need to be aware of a Source's capabilities and may influence the capabilities that the Source offers to the application's users. To do this, the application can perform capability negotiation.

The application generally follows this process:

  1. Determine if the selected Source supports a particular capability.

    2.
  2. Inquire about the Current Value for this capability. Also, inquire about the capability's Default Value and the set of Available Values that are supported by the Source for that capability.

    3.
  3. Request that the Source set the Current Value to the application's desired value. The Current Value will be displayed as the current selection in the Source's user interface.

    4.
  4. Limit, if needed, the Source's Available Values to a subset of what would normally be offered. For instance, if the application wants only black and white data, it can restrict the Source to transmit only that kind of data. If a limitation effects the Source's user interface, the Source should modify the interface to reflect those changes. For example, it may gray out options that are not available because of the application's restrictions.

    5.
  5. Verify that the new values have been accepted by the Source.

See Also

CapGet(),
CapGetCurrent(),
CapGetDefault(),
CapReset(), CapSet(),
How to Negotiate Capability with Different Capability Container Types


Capability Container Types

Capabilities exist in many varieties but all have a Default Value, Current Value, and may have other values available that can be supported if selected. To help categorize the supported values into clear structures, TWAIN defines four types of containers for capabilities: TW_ONEVALUE, TW_ARRAY, TW_RANGE and TW_ENUMERATION.

TW_ONEVALUE | A single value whose current and default values are coincident. The range of available values for this type of capability is simply this single value. For example, a capability that indicates the presence of a document feeder could be of this type.
TW_ARRAY | A rectangular array of values that describe a logical item. It is similar to the TW_ONEVALUE because the current and default values are the same and there are no other values to select from. For example, a list of the names, such as the supported capabilities list returned by the CAP_SUPPORTEDCAPS capability, would use this type of container.
TW_RANGE | Many capabilities allow users to select their current value from a range of regularly spaced values. The capability can specify the minimum and maximum acceptable values and the incremental step size between the values. For example, resolution might be supported from 100 to 600 in steps of 50 (100, 150, 200, ..., 550, 600).
TW_ENUMERATION | This is the most general type because it defines a list of values from which the Current Value can be chosen. The values do not progress uniformly through a range and there is not a consistent step size between the values. For example, if a Source's resolution options do not occur in even step sizes then an enumeration would be used (for example, 150, 400, and 600).

See also:

CapType property


Capability Negotiation Operation Types

There are 5 capability negotiation operation types defined by Dynamic TWAIN: CapGet(), CapGetCurrent(), CapGetDefault(), CapSet(), CapReset().

CapGet() | Returns the Source's Current, Default and Available Values for a specified capability. These values reflect previous CapSet() operations on the capability, or Source's automatic changes.
CapGetCurrent() | Returns the Source's Current Value for the specified capability. The Current Value reflects previous CapSet() operations on the capability, or Source's automatic changes.
CapGetDefault() | Returns the Source's Default Value. This is the Source's preferred default value. The Source's Default Value cannot be changed.
CapSet() | Changes the Current Value(s) and Available Values of the specified capability to those specified by the application. Current Values are set when the container is a TW_ONEVALUE or TW_ARRAY. Available and Current Values are set when the container is a TW_ENUMERATION or TW_RANGE.
CapReset() | Change the Current Value of the specified capability back to its power-on value.

See Also

CapType property


How to Negotiate Capability with Different Capability Container Types

Topics included in this article that describe how to negotiate capability with different capability container types are:

  • Setting Capability with TW_ONEVALUE
  • Setting Capability with TW_ARRAY
  • Setting Capability with TW_ENUMERATION
  • Setting Capability with TW_RANGE
  • Reading Value(s) through Capability Negotiation

    • Setting Capability with TW_ONEVALUE

    TW_ONEVALUE capability container type can be used to set or return a single value (item) of a capability.

    To set a capability with TW_ONEVALUE container, the following steps are needed:

  • Call OpenSource() to bring Dynamic TWAIN to the state for capability negotiation;
  • Set the Capability property to the capability to be negotiated;
  • Set the CapType property to TW_ONEVALUE;
  • If the data type of the capability is String, set the value of CapValueString property. For any other data types, set the value of CapValue property;
  • Call CapSet() to actually set the value.
    •

    VB Sample:
    Twain.OpenSource

Twain.Capability = ICAP_UNITS
Twain.CapType = TWON_ONEVALUE
Twain.CapValue = 0        'TWUN_INCHES

If Twain.CapSet = True Then
    MsgBox "Successful."
Else
    MsgBox "Failed." + vbCrLf + Twain.ErrorString, vbCritical + vbOKOnly
End If

    Setting Capability with TW_ARRAY

    TW_ARRAY capability container type can be used to set or return a group of associated individual values.

    To set a capabilIty with TW_ARRAY container, the following steps are needed:

  • Call OpenSource() to bring Dynamic TWAIN to the state for capability negotiation;
  • Set the Capability property to the capability to be negotiated;
  • Set the CapType property to TW_ARRAY;
  • Set the CapNumItems property to indicate how many items are in the array;
  • If the data type of the capability is String, set the values of CapItemsString property. For any other data types, set the values of CapItems property;
  • Call CapSet() to actually set the value.
    •

    VB Sample:
    Twain.OpenSource
    Twain.Capability = ICAP_FILTER
Twain.CapType = TWON_ARRAY
Twain.CapNumItems = 3    'Set cap values count.
    'Set the cap's values
Twain.CapItems(0) = 3    'TWFT_NONE
Twain.CapItems(1) = 1    'TWFT_GREEN
Twain.CapItems(2) = 2    'TWFT_BLUE
    If Twain.CapSet = True Then
    MsgBox "Successful."
Else
    MsgBox "Failed." + vbCrLf + Twain.ErrorString, vbCritical + vbOKOnly
End If

    Setting Capability with TW_ENUMERATION

    TW_ENUMERATION capability container type can be used to set or return a group of associated individual values describing a capability. The values are ordered from the lowest to highest values, but the step size between every two values is probably not uniform.

    To set a capability with TW_ENUMERATION container, the following steps are needed:

  • Call OpenSource() to bring Dynamic TWAIN to the state for capability negotiation;
  • Set the Capability property to the capability to be negotiated;
  • Set the CapType property to TW_ENUMERATION;
  • Set the CapNumItems property to indicate how many items are in the array;
  • If the data type of the capability is String, set the values of CapItemsString property. For any other data types, set the values of CapItems property;
  • Set the CapCurrentIndex to indicate the index of the current value;
  • Call CapSet() to actually set the value.
    •

    VB Sample:
    Twain.OpenSource
    Twain.Capability = ICAP_XRESOLUTION
Twain.CapType = TWON_ENUMERATION
Twain.CapNumItems = 3    'Set the cap values count.
    'Set the cap's values
Twain.CapItems(0) = 80
Twain.CapItems(1) = 100
Twain.CapItems(2) = 120
    Twain.CapCurrentIndex = 2    'Set the cap's current value's index in the ENEMERATION.
    If Twain.CapSet = True Then
    MsgBox "Successful."
Else
    MsgBox "Failed." + vbCrLf + Twain.ErrorString, vbCritical + vbOKOnly
End If

    Setting Capability with TW_RANGE

    TW_RANGE capability container type can be used to set or return a range of individual values describing a capability. The values are uniformly distributed between a minimum and a maximum value. The step size between every two values is constant.

    To set a capability with TW_RANGE container, the following steps are needed:

  • Call OpenSource() to bring Dynamic TWAIN to the state for capability negotiation;
  • Set the Capability property to the capability to be negotiated;
  • Set the CapType property to TW_RANGE;
  • Set the CapMinValue, CapMaxValue, CapStepSize and CapCurrentValue properties;
  • Call CapSet() to actually set the value.
    •

    VB Sample:
    Twain.OpenSource
    Twain.Capability = ICAP_XRESOLUTION
Twain.CapType = TWON_RANGE
    'Set the cap's values
Twain.CapMinValue = 80
Twain.CapMaxValue = 200
Twain.CapStepSize = 20
Twain.CapCurrentValue = 120
    If Twain.CapSet = True Then
    MsgBox "Successful."
Else
    MsgBox "Failed." + vbCrLf + Twain.ErrorString, vbCritical + vbOKOnly
End If

    Reading Value(s) from Capability Negotiation

    To read values from a capability:

  • Call OpenSource() to bring Dynamic TWAIN to the state for capability negotiation;
  • Set the Capability property to the capability to be negotiated;
  • Call CapGet() to get the data;
  • Get the data according to the returned capability container type.
    •

    VB Sample:
    Twain.OpenSource

Twain.Capability = CAP_xxx

If Twain.CapGet = False Then
    MsgBox "Failed." + vbCrLf + Twain.ErrorString, vbCritical + vbOKOnly
    Exit Sub
End If

If (Twain.CapType = TWON_ONEVALUE) Then

    txtCap = "Container type is TWON_ONEVALUE" + vbCrLf
    txtCap = txtCap + "Current Value:" + Twain.CapValue + vbCrLf

ElseIf (Twain.CapType = TWON_ARRAY) Then

    txtCap = "Container type is TWON_ARRAY"+ vbCrLf
    txtCap = txtCap + "Available Values:"

    For lngIndex =0 To Twain.CapNumItems - 1

        If (lngIndex < Twain.CapNumItems - 1) Then
            txtCap = txtCap + CStr(Twain.CapItems(lngIndex)) + ","
        Else
            txtCap = txtCap + CStr(Twain.CapItems(lngIndex))
        End If

    Next

ElseIf (Twain.CapType = TWON_ENUMERATION) Then

    txtCap = "Container type is TWON_ENUMERATION"+ vbCrLf
    txtCap = txtCap + "Current Value:" + CStr(Twain.CapItems(Twain.CapCurrentIndex))+ vbCrLf
    txtCap = txtCap + "Default Value:" + CStr(Twain.CapItems(Twain.CapDefaultIndex))+ vbCrLf
    txtCap = txtCap + "Available Values:"

    For lngIndex = 0 To Twain.CapNumItems - 1

        If (lngIndex < Twain.CapNumItems - 1) Then
            txtCap = txtCap + CStr(Twain.CapItems(lngIndex)) + ","
        Else
            txtCap = txtCap + CStr(Twain.CapItems(lngIndex))
        End If
    Next

ElseIf (Twain.CapType = TWON_RANGE) Then

    txtCap = "Container type is TWON_RANGE"+ vbCrLf
    txtCap = txtCap + "Current Value:" + CStr(Twain.CapCurrentValue)+ vbCrLf
    txtCap = txtCap + "Default Value:" + CStr(Twain.CapDefaultValue)+ vbCrLf
    txtCap = txtCap + "Min Value:" + CStr(Twain.CapMinValue)+ vbCrLf
    txtCap = txtCap + "Max Value:" + CStr(Twain.CapMaxValue)+ vbCrLf
    txtCap = txtCap + "Step Size:" + CStr(Twain.CapStepSize)

End If

    See Also

    Capability Container Types


How to negotiate ICAP_FRAMES

The process of negotiating ICAP_FRAMES is the same as all the other capabilities. However, Frame has 4 data members: Left, Top, Right and Bottom, which can not be held in CapValue, CapValueString, CapItems or CapItemsString properties. Dynamic TWAIN provides several methods to deal with Frame: CapGetFrameLeft(), CapGetFrameTop(), CapGetFrameRight(), CapGetFrameBottom() and CapSetFrame().

For the general steps of capability negotiation, please refer to How to Negotiate Capability with Different Capability Container Types.

The followings are the samples of ICAP_FRAMES negotiation:

Getting frame information;

Setting one frame;

Setting multiple frames.

Getting frame information

VB Sample:

    Dim lngIndex As Long
    Dim strFrame As String

    Twain.OpenSource

    Twain.Capability = ICAP_FRAMES

    If Twain.CapGet = False Then
        MsgBox "Failed." + vbCrLf + Twain.ErrorString, vbCritical + vbOKOnly
        Exit Sub
    End If

    If Twain.CapType = TWON_ONEVALUE Then
        strFrame = "Frame left: " + CStr(Twain.CapGetFrameLeft(0)) + vbCrLf
        strFrame = strFrame + "Frame top: " + CStr(Twain.CapGetFrameTop(0)) + vbCrLf
        strFrame = strFrame + "Frame right: " + CStr(Twain.CapGetFrameRight(0)) + vbCrLf
        strFrame = strFrame + "Frame bottom: " + CStr(Twain.CapGetFrameBottom(0))

        MsgBox strFrame

    ElseIf Twain.CapType = TWON_ENUMERATION Then
        For lngIndex = 0 To Twain.CapNumItems - 1

            strFrame = "Frame left: " + CStr(Twain.CapGetFrameLeft(lngIndex)) + vbCrLf
            strFrame = strFrame + "Frame top: " + CStr(Twain.CapGetFrameTop(lngIndex)) + vbCrLf
            strFrame = strFrame + "Frame right: " + CStr(Twain.CapGetFrameRight(lngIndex)) + vbCrLf
            strFrame = strFrame + "Frame bottom: " + CStr(Twain.CapGetFrameBottom(lngIndex))

            MsgBox strFrame

        Next lngIndex
    End If

Setting one frame

VB Sample:
    Twain.OpenSource

    Twain.Capability = ICAP_FRAMES
    Twain.CapType = TWON_ONEVALUE

    Twain.CapSetFrame 0, 0, 0, 5, 5

    If Twain.CapSet = True Then
        MsgBox "Successful."
    Else
        MsgBox "Failed." + vbCrLf + Twain.ErrorString, vbCritical + vbOKOnly
    End IfTwain.OpenSource

Setting multiple frames

VB Sample:
    Twain.OpenSource

    Twain.Capability = ICAP_FRAMES
    Twain.CapType = TWON_ENUMERATION

    Twain.CapNumItems = 2   ' 2 frames

    Twain.CapSetFrame 0, 0, 0, 5, 5
    Twain.CapSetFrame 1, 6, 6, 8, 8

    If Twain.CapSet = True Then
        MsgBox "Successful."
    Else
        MsgBox "Failed." + vbCrLf + Twain.ErrorString, vbCritical + vbOKOnly
    End If


Methods

Categorical list of all the properties and methods:

Capability Negotiation Group
Data Source Operating Group
General Purpose Group
Image Editor Group
Web Group

If you do NOT want to read this documentation or spend any time in TWAIN, please click here.

Capability Negotiation Group

CapGet Method
CapGetCurrent Method
CapGetDefault Method
CapGetFrameBottom Method
CapGetFrameLeft Method
CapGetFrameRight Method
CapGetFrameTop Method
CapIfSupported Method
CapReset Method
CapSet Method
CapSetFrame Method

RewindPage Method
FeedPage Method

Web Group

FTPDownload Method
FTPDownloadEx Method
FTPUpload Method
FTPUploadEx Method
HTTPDownload Method
HTTPDownloadEx Method
HTTPUploadThroughPut Method
 HTTPUploadThroughPostEx Method
 HTTPUploadThroughPost Method
HTTPUploadThroughPutEx Method
HTTPUploadAllThroughPostAsMultiPageTIFF Method
HTTPUploadAllThroughPostAsPDF Method HTTPUploadAllThroughPutAsMultiPageTIFF Method
HTTPUploadAllThroughPutAsPDF Method
FTPUploadAllAsMultiPageTIFF Method
FTPUploadAllAsPDF Method

SetHTTPFormField Method
ClearAllHTTPFormFiled Method

Image Editor Group

ShowImageEditor Method
RotateLeft Method
RotateRight Method
Flip Method
Mirror Method
Crop Method
CropToClipboard Method
GetImageSize Method
ChangeImageSize Method

Data Source Operating Group

CloseSource Method
CloseSourceManager Method
DisableSource Method
EnableSource Method
OpenSource Method
OpenSourceManager Method
SelectSource Method
SelectSourceByIndex Method

General Purpose Group

AcquireImage Method
CancelAllPendingTransfers Method
CopyToClipboard Method
CutToClipboard Method
GetImageLayout Method
GetDefaulttImageLayout Method
GetViewMode Method
LoadImage Method
LoadImageEx Method
LoadDibFromClipboard Method
SaveAsBMP Method
SaveAsJPEG Method
SaveAsTIFF Method
SaveAsPDF Method
SaveAsPNG Method
SaveAllAsMultiPageTIFF Method
SaveAllAsPDF Method
SetFileXferInfo Method
SetImageLayout Method
SetViewMode Method
ResetImageLayout Method
RemoveImage Method
RemoveAllImages Method


Method AcquireImage

AcquireImage Method

Description

Displays the source's built-in interface to acquire image.

Syntax

Boolean ObjectName. AcquireImage()

Parameters

None.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

This method does the same thing as EnableSource(). The purpose of providing this method is to enable user to handle Twain-compliant image acquisition device without knowing the terms used in Twain specification.

IMPORTANT: The value of this method is returned when the scanning starts.

See also

EnableSource()


Method CancelAllPendingTransfers

CancelAllPendingTransfers Method

Description

Cancels all pending transfers.

Syntax

Boolean ObjectName. CancelAllPendingTransfers()

Parameters

None.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

The CancelAllPendingTransfers method is valid only in OnPreAllTransfers, OnPreTransfer and OnPostTransfer events.

See also

PendingXFERs property


Method CapGet

CapGet Method

Description

Gets information of the capability specified by the Capability property.

Syntax

Boolean ObjectName. CapGet()

Parameters

None.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

Before invoking CapGet(), Capability property should be set.

CapType property needs not to be set, since when CapGet() is called, the container type is returned by the source, rather than specified by the application.

See also

Capability property, CapSet(), CapType property, ErrorCode property, ErrorString Property, How to Negotiate Capability with Different Capability Container Types

Sample

Refer to Reading Value(s) from Capability Negotiation.


Method CapGetCurrent

CapGetCurrent Method

Description

Returns the Source's current Value for the specified capability.

Syntax

Boolean ObjectName. CapGetCurrent()

Parameters

None.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

Before invoking CapGetCurrent(), Capability property should be set.

After calling CapGetCurrent(), check CapType property for the capability container type and then read information from different properties according to the container type. This process is the same as CapGet(), please refer to CapType property and Reading Value(s) from Capability Negotiation.

See also

Capability property, CapGet(), CapGetDefault(), CapSet(), CapType property


Method CapGetDefault

CapGetDefault Method

Description

Returns the Source's Default Value for the specified capability. This is the Source's preferred default value.

Syntax

Boolean ObjectName. CapGetDefault()

Parameters

None.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

Before invoking CapGetDefault(), Capability property should be set.

The Source's Default Value cannot be changed.

Using the Source's preferred default as the Current Value may increase performance in some Sources.

See also

Capability property, CapGet(), CapGetCurrent(), CapSet(), CapType property


Method CapGetFrameBottom

CapGetFrameBottom Method

Description

Returns the value (in ICAP_UNITS) of the bottom-most edge of the specified frame.

Syntax

Single ObjectName. CapGetFrameBottom(Integer Index)

Parameters

Integer Index: specifies the value of which frame to get. The index is 0-based.

Return value

The data type of the return value is Single (float).

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

The unit of CapGetFrameBottom() is determined by ICAP_UNITS capability.

The default unit is assumed to be "inches" unless it has been otherwise negotiated between the application and source.

CapGetFrameBottom() is different from ImageLayoutFrameBottom property.

CapGetFrameBottom() is part of ICAP_FRAMES capability negotiation. It can return the value of any frames in a page.

ImageLayoutFrameBottom property only returns the value of the current frame which is being transferred. It is valid only in OnPreTransfer and OnPostTransfer event.

See also

CapGetFrameLeft(),
CapGetFrameTop(),
CapGetFrameRight(),
CapSetFrame()

Sample

Refer to How to negotiate ICAP_FRAMES


Method CapGetFrameLeft

CapGetFrameLeft Method

Description

Returns the value (in ICAP_UNITS) of the left-most edge of the specified frame.

Syntax

Single ObjectName. CapGetFrameLeft(Integer Index)

Parameters

Integer Index: specifies the value of which frame to get. The index is 0-based.

Return value

The data type of the return value is Single (float).

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

The unit of CapGetFrameLeft() is determined by ICAP_UNITS capability.

The default unit is assumed to be "inches" unless it has been otherwise negotiated between the application and source.

CapGetFrameLeft() is different from ImageLayoutFrameLeft property.

CapGetFrameLeft() is part of ICAP_FRAMES capability negotiation. It can return the value of any frames in a page.

ImageLayoutFrameleft property only returns the value of the current frame which is being transferred. It is valid only in OnPreTransfer and OnPostTransfer event.

See also

CapGetFrameTop(),
CapGetFrameRight(),
CapGetFrameBottom(),
CapSetFrame()

Sample

Refer to How to negotiate ICAP_FRAMES


Method CapGetFrameRight

CapGetFrameRight Method

Description

Returns the value (in ICAP_UNITS) of the right-most edge of the specified frame.

Syntax

Single ObjectName. CapGetFrameRight(Integer Index)

Parameters

Integer Index: specifies the value of which frame to get. The index is 0-based.

Return value

The data type of the return value is Single (float).

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

The unit of CapGetFrameRight() is determined by ICAP_UNITS capability.

The default unit is assumed to be "inches" unless it has been otherwise negotiated between the application and source.

CapGetFrameRight() is different from ImageLayoutFrameRight property.

CapGetFrameRight() is part of ICAP_FRAMES capability negotiation. It can return the value of any frames in a page.

ImageLayoutFrameRight property only returns the value of the current frame which is being transferred. It is valid only in OnPreTransfer and OnPostTransfer event.

See also

CapGetFrameLeft(),
CapGetFrameTop(),
CapGetFrameBottom(),
CapSetFrame()

Sample

Refer to How to negotiate ICAP_FRAMES


Method CapGetFrameTop

CapGetFrameTop Method

Description

Returns the value (in ICAP_UNITS) of the top-most edge of the specified frame.

Syntax

Single ObjectName. CapGetFrameTop(Integer Index)

Parameters

Integer Index: specifies the value of which frame to get. The index is 0-based.

Return value

The data type of the return value is Single (float).

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

The unit of CapGetFrameTop() is determined by ICAP_UNITS capability.

The default unit is assumed to be "inches" unless it has been otherwise negotiated between the application and source.

CapGetFrameTop() is different from ImageLayoutFrameTop property.

CapGetFrameTop() is part of ICAP_FRAMES capability negotiation. It can return the value of any frames in a page.

ImageLayoutFrameTop property only returns the value of the current frame which is being transferred. It is valid only in OnPreTransfer and OnPostTransfer event.

See also

CapGetFrameLeft(),
CapGetFrameRight(),
CapGetFrameBottom(),
CapSetFrame()

Sample

Refer to How to negotiate ICAP_FRAMES


Method CapIfSupported

CapIfSupported Method

Description

Queries whether the Source supports a particular operation on the capability.

Syntax

Boolean ObjectName. CapIfSupported(Integer MessageType)

Parameters

Integer(enumerated value) MessageType: specifies the type of capability operation.

Value | Description
TWQC_GET (1) | If CapGet() is supported by the capability.
TWQC_SET (2) | If CapSet() is supported by the capability.
TWQC_GETDEFAULT (4) | If CapGetDefault() is supported by the capability.
TWQC_GETCURRENT (8) | If CapGetCurrent() is supported by the capability.
TWQC_RESET (16) | If CapReset() is supported by the capability.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

The capability to query should be set in Capability property before calling CapIfSupported().

See also

Capability property,
CapSet(),
CapGet(), CapGetCurrent(),
CapGetDefault(),
CapReset()


Method CapReset

CapReset Method

Description

Changes the Current Value of the capability specified by Capability property back to its power-on value.

Syntax

Boolean ObjectName. CapReset()

Parameters

None.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

Before invoking CapReset, Capability property should be set.

See also

Capability property.


Method CapSet

CapSet Method

Description

Sets the current capability using the container type specified by CapType property. The current capability is specified by Capability property.

Syntax

Boolean ObjectName. CapSet()

Parameters

None.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

For different capability container types, the properties need to be set are different. Before calling CapSet(), the corresponding properties should be set. Refer to How to Negotiate Capability with Different Capability Container Types for details.

See also

Capability property, CapGet(), CapType property

Sample

Refer to How to Negotiate Capability with Different Capability Container Types.


Method CapSetFrame

CapSetFrame Method

Description

Sets the values of the specified frame.

Syntax

Boolean ObjectName. CapSetFrame(Integer Index, Single Left, Single Top, Single Right, Single Bottom)

Parameters

Integer Index: specifies the values of which frame to set. The index is 0-based.

Single(float) Left: the value (in ICAP_UNITS) of the left-most edge of the specified frame.

Single(float) Top: the value (in ICAP_UNITS) of the top-most edge of the specified frame.

Single(float) Right: the value (in ICAP_UNITS) of the right-most edge of the specified frame.

Single(float) Bottom: the value (in ICAP_UNITS) of the bottom-most edge of the specified frame.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

The default unit is assumed to be "inches" unless it has been otherwise negotiated between the application and source.

See also

CapGetFrameLeft(),
CapGetFrameTop(),
CapGetFrameRight(),
CapGetFrameBottom()

Sample

Refer to How to negotiate ICAP_FRAMES


Method ChangeImageSize

ChangeImageSize Method

Description

Changes the display size of the image of a specified index in buffer.

Syntax

Boolean ObjectName. ChangeImageSize(Short sImageIndex, Long lNewwidth, Long lnewheight, enumInterpolationMethod InterpolationMethod)

Parameters

Short sImageIndex: specifies the index of image in buffer. The index is 0-based.

Long lWidth: specifies the pixel width of the new image.

Long lHeight: specifies the pixel height of the new image.

enumInterpolationMethod InterpolationMethod: specifies the method to do interpolation.

Allowed Values | Interpolation Method
1 | NearestNeighbor
2 | Bilinear
3 | Bicubic

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

ChangeImageSize() changes the display size of an image and replaces the original image with new one.

See Also

RotateLeft(),
RotateRight(),
Flip(), Mirror(),
Crop(),
CropToClipboard(), GetImageSize(),
ShowImageEditor(),
ImageEditorWindowTitle property,
ImageEditorIfReadonly property,
ImageEditorIfEnableEnumerator
property


Method ClearAllHTTPFormFiled

ClearAllHTTPFormFiled Method

Description

Clears all the web forms which are used for image uploading.

Syntax

Boolean ObjectName. ClearAllHTTPFormFiled()

Parameters

None.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

None.

See also

SetHTTPFormField(), ImageMargin property, MouseShape property


Method CloseSource

CloseSource Method

Description

Closes Data Source.

Syntax

Boolean ObjectName. CloseSource()

Parameters

None.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

CloseSource() is called automatically if necessary, since Dynamic (Web) TWAIN has built-in Wizard Mode.

See also

OpenSource()


Method CloseSourceManager

CloseSourceManager Method

Description

Closes and unloads Data Source Manager.

Syntax

Boolean ObjectName. CloseSourceManager()

Parameters

None.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

CloseSourceManager() is called automatically when Dynamic (Web) TWAIN is released if it is not called explicitly by the application.

See also

OpenSourceManager()


Method CopyToClipboard

CopyToClipboard Method

Description

Copies the image of a specified index in buffer to clipboard in DIB format.

Syntax

Boolean ObjectName. CopyToClipboard(Short sImageIndex)

Parameters

Short sImageIndex: specifies the index of image in buffer. The index is 0-based.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

CopyToClipboard() makes a copy of the image to the clipboard. If the application does not need the image in Dynamic (Web) TWAIN any more, use CutToClipboard(), which can save memory, especially when the image is large.

The copied image is in DIB format.

See also

CutToClipboard()

Sample

VB Sample:
Private Sub Twain_OnPostTransfer()

    Twain.CopyToClipboard(0)
    imgShowImage.Picture = Clipboard.GetData(vbCFDIB)
    Clipboard.Clear

End Sub


Method Crop

Crop Method

Description

Crops the image of a specified index in buffer.

Syntax

Boolean ObjectName. Crop(Short sImageIndex, Long left, Long top, long right, long bottom)

Parameters

Short sImageIndex: specifies the index of image in buffer. The index is 0-based.

Long left: specifies the x-coordinate of the upper-left corner of the rectangle.

Long top: specifies the y-coordinate of the upper-left corner of the rectangle.

Long right: specifies the x-coordinate of the lower-right corner of the rectangle.

Long bottom: specifies the y-coordinate of the lower-right corner of the rectangle.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

Crop() crops an image and replaces the original image with the cropped copy. If the application still needs the original image, use CropToClipboard().

See Also

CropToClipboard(), RotateLeft(),
RotateRight(),
Flip(), Mirror(),
GetImageSize(),
ChangeImageSize(),
ShowImageEditor(),
ImageEditorWindowTitle property,
ImageEditorIfReadonly property,
ImageEditorIfEnableEnumerator
property


Method CropToClipboard

CropToClipboard Method

Description

Crops the image of a specified index in buffer to clipboard in DIB format.

Syntax

Boolean ObjectName. CropToClipboard(Short sImageIndex, Long left, Long top, long right, long bottom)

Parameters

Short sImageIndex: specifies the index of image in buffer. The index is 0-based.

Long left: specifies the x-coordinate of the upper-left corner of the rectangle.

Long top: specifies the y-coordinate of the upper-left corner of the rectangle.

Long right: specifies the x-coordinate of the lower-right corner of the rectangle.

Long bottom: specifies the y-coordinate of the lower-right corner of the rectangle.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

CropToClipboard() crops an image and makes a copy of the cropped image to the clipboard. If the application does not need the original image in Dynamic (Web) TWAIN any more, use Crop().

See Also

Crop(), RotateLeft(), RotateRight(), Flip(), Mirror(), GetImageSize(), ChangeImageSize(), ShowImageEditor(),
ImageEditorWindowTitle property, ImageEditorIfReadonly property, ImageEditorIfEnableEnumerator property


Method CutToClipboard

CutToClipboard Method

Description

Cuts the image of a specified index in buffer to clipboard in DIB format.

Syntax

Boolean ObjectName. CutToClipboard(Short sImageIndex)

Parameters

Short sImageIndex: specifies the index of image in buffer. The index is 0-based.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

CutToClipboard() cuts the image to the clipboard. If the application still needs the image in Dynamic (Web) TWAIN, use CopyToClipboard().

The image is in DIB format.

See also

CopyToClipboard()

Sample

VB Sample:
Private Sub Twain_OnPostTransfer()

    Twain.CutToClipboard(0)
    imgShowImage.Picture = Clipboard.GetData(vbCFBitmap)
    Clipboard.Clear

End Sub


Method DisableSource

DisableSource Method

Description

Disable the source. If the source's user interface is displayed when the source is enabled, it will be closed.

Syntax

ObjectName. DisableSource()

Parameters

None.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

After DisableSource(), the Source is returned to State 4, where capability negotiation can again occur.

See also

EnableSource(), OpenSource(), TWAIN State Transition.


Method EnableSource

EnableSource Method

Description

Enables the source to accept image.

Syntax

Boolean ObjectName. EnableSource()

Parameters

None.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

None.

See also

IfShowUI property, DisableSource(), TWAIN State Transition.


Method FeedPage

FeedPage Method

Description

Sets the Source to eject the current page and advance the next page in the document feeder into the feeder acquire area when IfFeederEnabled is TRUE.

Syntax

Boolean ObjectName. FeedPage()

Parameters

None.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

Using this property after opening the Data Source (see OpenSource() method) and checking if the value of IfFeederEnabled property is TRUE.

See also

IfFeederEnabled property, IfAutoFeed property


Method Flip

Flip Method

Description

Flips the image of a specified index in buffer.

Syntax

Boolean ObjectName. Flip(Short sImageIndex)

Parameters

Short sImageIndex: specifies the index of image in buffer. The index is 0-based.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

Flip() flips an image and replaces the original image with the flipped copy.

See Also

RotateLeft(),
RotateRight(),
Mirror(), Crop(),
CropToClipboard(),
GetImageSize(),
ChangeImageSize(),
ShowImageEditor(),
ImageEditorWindowTitle property,
ImageEditorIfReadonly property,
ImageEditorIfEnableEnumerator
property


Method FTPDownload

FTPDownload Method

Description

Downloads an image from the FTP server.

Syntax

Boolean ObjectName. FTPDownload(String FTPServer, String FTPRemoteFile)

Parameters

String FTPServer: the name of the FTP server.

String FTPRemoteFile: the name of the file to be downloaded.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

Dynamic Web TWAIN processes the image format according to the extension of the FTPRemoteFile.

Dynamic Web TWAIN supports the following types of image files:

Bitmap | *.bmp, *.dib
JPEG | *.JPG, *.JPEG, .*.JPE, *.JFIF
TIFF | *.TIF, *.TIFF
PNG | *.PNG

FTPRemoteFile parameter should include the FTP directory of the file.

The image downloaded will be displayed in Dynamic Web TWAIN, just as it is acquired from a TWAIN Data Source.

See also

FTPUserName property, FTPPassword property, FTPPort property, ProxyServer property, FTPUpload(), HTTPPort property, HTTPUserName property, HTTPPassword property, HTTPDownload(), HTTPUploadThroughPut(), HTTPUploadThroughPost()


Method FTPDownloadEx

FTPDownloadEx Method

Description

Downloads an image from the FTP server.

Syntax

Boolean ObjectName. FTPDownloadEx(String FTPServer, String FTPRemoteFile, Long ImageType)

Parameters

String FTPServer: the name of the FTP server.

String FTPRemoteFile: the name of the file to be downloaded.

Long ImageType: the image format of the file to be downloaded.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

Dynamic Web TWAIN processes the image format according to the value of the ImageType.

Allowed Values | ImageType
0 | BMP
1 | JPEG
2 | TIFF
3 | PNG
4 | PDF

FTPRemoteFile parameter should include the FTP directory of the file.

The image downloaded will be displayed in Dynamic Web TWAIN, just as it is acquired from a TWAIN Data Source.

See also

FTPUserName property, FTPPassword property, FTPPort property, ProxyServer property, FTPUploadEx(), FTPDownload(), HTTPPort property, HTTPUserName property, HTTPPassword property, HTTPDownloadEx(), HTTPUploadThroughPutEx(), HTTPUploadThroughPostEx()


Method FTPUpload

FTPUpload Method

Description

Uploads the image of a specified index in buffer to the FTP server.

Syntax

Boolean ObjectName. FTPUpload (String FTPServer, Short sImageIndex, String FTPRemoteFile)

Parameters

String FTPServer: the name of the FTP server.

Short sImageIndex: specifies the index of image in buffer. The index is 0-based.

String FTPRemoteFile: the name of the file to be created on the FTP server.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

Dynamic Web TWAIN processes the image format according to the extension of the FTPRemoteFile.

Dynamic Web TWAIN supports the following types of image files:

Bitmap | *.bmp, *.dib
JPEG | *.JPG, *.JPEG, .*.JPE, *.JFIF
TIFF | *.TIF, *.TIFF
PNG | *.PNG

FTPRemoteFile parameter should include the FTP directory of the file.

Write permission of the specified directory is needed for uploading.

See also

FTPUserName property, FTPPassword property, FTPPort property, ProxyServer property, FTPDownload(), HTTPPort property, HTTPUserName property, HTTPPassword property, HTTPDownload(),, HTTPUploadThroughPut(), HTTPUploadThroughPost()


Method FTPUploadEx

FTPUploadEx Method

Description

Uploads the image of a specified index in buffer to the FTP server as a specified image format.

Syntax

Boolean ObjectName. FTPUploadEx(String FTPServer, Short sImageIndex, String FTPRemoteFile, Long ImageType)

Parameters

String FTPServer: the name of the FTP server.

Short sImageIndex: specifies the index of image in buffer. The index is 0-based.

String FTPRemoteFile: the name of the file to be created on the FTP server.

Long ImageType: the image format of the file to be created on the FTP server.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

Dynamic Web TWAIN processes the image format according to the value of the ImageType.

Allowed Values | ImageType
0 | BMP
1 | JPEG
2 | TIFF
3 | PNG
4 | PDF

FTPRemoteFile parameter should include the FTP directory of the file.

Write permission of the specified directory is needed for uploading.

See also

FTPUserName property, FTPPassword property, FTPPort property, ProxyServer property, FTPUpload(), FTPDownloadEx(), HTTPPort property, HTTPUserName property, HTTPPassword property, HTTPDownloadEx(), HTTPUploadThroughPutEx(), HTTPUploadThroughPostEx()


Method FTPUploadAllAsMultiPageTIFF

FTPUploadAllAsMultiPageTIFF Method

Description

Uploads all images in buffer to the FTP server as Multi-Page TIFF.

Syntax

Boolean ObjectName. FTPUploadAllAsMultiPageTIFF(String FTPServer, String FileName)

Parameters

String FTPServer: the name of the FTP server.

String FileName: the name of the image to be uploaded.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

None.

See also

FTPUserName property, FTPPassword property, FTPPort property, ProxyServer property, FTPDownload(), FTPUpload(), HTTPPort property, HTTPUserName property, HTTPPassword property, HTTPDownload(),, HTTPUploadThroughPost(), HTTPUploadThroughPut(), HTTPUploadAllThroughPostAsMultiPageTIFF(), HTTPUploadAllThroughPutAsMultiPageTIFF()


Method FTPUploadAllAsPDF

FTPUploadAllAsPDF Method

Description

Uploads all images in buffer to the FTP server as Multi-Page PDF.

Syntax

Boolean ObjectName. FTPUploadAllAsPDF(String FTPServer, String FileName)

Parameters

String FTPServer: the name of the FTP server.

String FileName: the name of the image to be uploaded.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

None.

See also

FTPUserName property, FTPPassword property, FTPPort property, ProxyServer property, FTPDownload(), FTPUpload(), HTTPPort property, HTTPUserName property, HTTPPassword property, HTTPDownload(),, HTTPUploadThroughPost(), HTTPUploadThroughPut(), HTTPUploadAllThroughPostAsPDF(), HTTPUploadAllThroughPutAsPDF()


Method GetDefaultImageLayout

GetDefaultImageLayout Method

Description

Retrieves the left, top, right, and bottom sides of the current Data Source's default image layout rectangle.

Syntax

Boolean ObjectName. GetDefaultImageLayout(Float *pLeft, Float *pTop, Float *pRight, Float *pBottom)

Parameters

Float *pLeft: the floating point number for the left side of the default image layout rectangle.

Float *pTop: the floating point number for the top side of the default image layout rectangle.

Float *pRight: the floating point number for the right side of the default image layout rectangle.

Float *pBottom: the floating point number for the bottom side of the default image layout rectangle.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

The image layout rectangle defines what portion of the Data Source's scanning area is acquired.

See also

GetImageLayout(), ResetImageLayout(), SetImageLayout()


Method GetImageLayout

GetImageLayout Method

Description

Retrieves the left, top, right, and bottom sides of the image layout rectangle for the current Data Source.

Syntax

Boolean ObjectName. GetImageLayout(Float *pLeft, Float *pTop, Float *pRight, Float *pBottom)

Parameters

Float *pLeft: the floating point number for the left side of the image layout rectangle.

Float *pTop: the floating point number for the top side of the image layout rectangle.

Float *pRight: the floating point number for the right side of the image layout rectangle.

Float *pBottom: the floating point number for the bottom side of the image layout rectangle.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

The image layout rectangle defines what portion of the Data Source's scanning area is acquired.

See also

GetDefaultImageLayout(), ResetImageLayout(), SetImageLayout()


Method GetImageSize

GetImageSize Method

Description

Returns the file size of the new image resized from the image of a specified index in buffer.

Syntax

Double ObjectName. GetImageSize(Short sImageIndex, Long lWidth, Long lHeight)

Parameters

Short sImageIndex: specifies the index of image in buffer. The index is 0-based.

Long lWidth: specifies the pixel width of the new image.

Long lHeight: specifies the pixel height of the new image.

Return value

Double.

-1 indicates failure. Other values indicate success.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

None.

See Also

RotateLeft(),
RotateRight(),
Flip(), Mirror(),
Crop(),
CropToClipboard(), ChangeImageSize(),
ShowImageEditor(),
ImageEditorWindowTitle property,
ImageEditorIfReadonly property,
ImageEditorIfEnableEnumerator
property


Method GetViewMode

GetViewMode Method

Description

Gets the view mode that images are displayed in Dynamic Web TWAIN.

Syntax

Void ObjectName. GetViewMode(Short *sHorizontalImageCount, *Short sVerticalImageCount)

Parameters

Short *sHorizontalImageCount: the short number for the columns can be displayed in Dynamic Web TWAIN.

Short *sVerticalImageCount: the short number for the rows can be displayed in Dynamic Web TWAIN.

Return value

Void.

Remarks

The default is 1 by 1.

See also

SetViewMode(), ImageMargin property, MouseShape property


Method HTTPDownload

HTTPDownload Method

Description

Downloads an image from the HTTP server.

Syntax

Boolean ObjectName. HTTPDownload(String HTTPServer, String HTTPRemoteFile)

Parameters

String HTTPServer: the name of the HTTP server.

String HTTPRemoteFile: the name of the image to be downloaded.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

Dynamic Web TWAIN processes the image format according to the extension of the HTTPRemoteFile.

Dynamic Web TWAIN supports the following types of image files:

Bitmap | *.bmp, *.dib
JPEG | *.JPG, *.JPEG, .*.JPE, *.JFIF
TIFF | *.TIF, *.TIFF
PNG | *.PNG

HTTPRemoteFile parameter should include the HTTP directory of the file.

The image downloaded will be displayed in Dynamic Web TWAIN, just as it is acquired from a TWAIN Data Source.

See also

FTPUserName property, FTPPassword property, FTPPort property, ProxyServer property, FTPDownload(), FTPUpload(), HTTPPort property, IfSSL property, HTTPUserName property, HTTPPassword property, HTTPUploadThroughPost(), HTTPUploadThroughPut()


Method HTTPDownloadEx

HTTPDownloadEx Method

Description

Downloads an image from the HTTP server.

Syntax

Boolean ObjectName. HTTPDownloadEx(String HTTPServer, String HTTPRemoteFile, Long ImageType)

Parameters

String HTTPServer: the name of the HTTP server.

String HTTPRemoteFile: the name of the image to be downloaded.

Long ImageType: the image format of the file to be downloaded.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

Dynamic Web TWAIN processes the image format according to the value of the ImageType.

Allowed Values | ImageType
0 | BMP
1 | JPEG
2 | TIFF
3 | PNG
4 | PDF

HTTPRemoteFile parameter should include the HTTP directory of the file.

The image downloaded will be displayed in Dynamic Web TWAIN, just as it is acquired from a TWAIN Data Source.

See also

FTPUserName property, FTPPassword property, FTPPort property, ProxyServer property, FTPDownloadEx(), HTTPPort property, HTTPUserName property, HTTPPassword property, HTTPDownload(), HTTPUploadThroughPutEx(), HTTPUploadThroughPostEx()


Method HTTPUploadThroughPost

HTTPUploadThroughPost Method

Description

Uploads the image of a specified index in buffer to the HTTP server through HTTP POST method.

Syntax

Boolean ObjectName. HTTPUploadThroughPost(String HTTPServer, Short sImageIndex, String ActionPage, String FileName)

Parameters

String HTTPServer: the name of the HTTP server.

Short sImageIndex: specifies the index of image in buffer. The index is 0-based.

String ActionPage: the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". This is the page corresponds to the action in <form> html tag: <form id = "frmSample" action = "upload.asp" method = post>...</form>

String FileName: the name of the image to be uploaded.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

Dynamic Web TWAIN processes the image format according to the extension of the FileName.

Dynamic Web TWAIN supports the following types of image files:

Bitmap | *.bmp, *.dib
JPEG | *.JPG, *.JPEG, .*.JPE, *.JFIF
TIFF | *.TIF, *.TIFF
PNG | *.PNG

The field name of the uploaded image is RemoteFile.

IMPORTANT: 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, even the "<HTML>".

See also

FTPUserName property, FTPPassword property, FTPPort property, ProxyServer property, FTPDownload(), FTPUpload(), HTTPPort property, IfSSL property, HTTPUserName property, HTTPPassword property, HTTPDownload(),, HTTPUploadThroughPut()

Sample

A simple PHP sample is provided. Should you need sample in other languages, please access the following page to download samples.
https://www.dynamsoft.com/Secure/RegisterInfo_sample.aspx

PHP Sample:

Scan.php:
<html>
<head>
<title>begin to scan -- demo of Dynamic Web TWAIN</title>

<SCRIPT LANGUAGE="javascript">

function btnScan_onclick() {
frmScan.DynamicWebTwain1.SelectSource();
frmScan.DynamicWebTwain1.AcquireImage();
}

function btnUpload_onclick() {

frmScan.DynamicWebTwain1.HTTPPort = 80; // if 80 is the port number of non-secure port
frmScan.DynamicWebTwain1.IfSSL = false;
frmScan.DynamicWebTwain1.HTTPUploadThroughPost("127.0.0.1", 0, "/SaveToFile.php", "imageData.jpg");

if (frmScan.DynamicWebTwain1.ErrorCode != 0)
alert(frmScan.DynamicWebTwain1.ErrorString);
else //succeded
alert("Successful");
}

</script>
</head>

<body>

<object CLASSID = "clsid:5220cb21-c88d-11cf-b347-00aa00a28331" VIEWASTEXT>
<param name="LPKPath" value="DynamicWebTwain.lpk"/>
</object>

<p align="center">

<b>Scan an image</b> <br><br><br>

<form id="frmScan" name="frmScan">

<object classid="clsid:E7DA7F8D-27AB-4EE9-8FC0-3FEC9ECFE758" id="DynamicWebTwain1" width="143" height="156"
CodeBase = "DynamicWebTWAIN.cab#version=5,0">
<param name="_cx" value="847"/>
<param name="_cy" value="847"/>
<param name="JpgQuality" value="80"/>
<param name="Manufacturer" value="Dynamsoft Corporation"/>
<param name="ProductFamily" value="Dynamic Web TWAIN"/>
<param name="ProductName" value="Dynamic Web TWAIN"/>
<param name="VersionInfo" value="Dynamic Web TWAIN 5.0"/>
<param name="TransferMode" value="0"/>
<param name="BorderStyle" value="0"/>
<param name="FTPUserName" />
<param name="FTPPassword" />
<param name="FTPPort" value="21"/>
<param name="HTTPUserName" />
<param name="HTTPPassword" />
<param name="HTTPPort" value="80"/>
<param name="ProxyServer" />
<param name="IfDisableSourceAfterAcquire" value="0"/>
<param name="IfShowUI" value="1"/>
<param name="IfModalUI" value="1"/>
<param name="IfTiffMultiPage" value="0"/>
<param name="IfThrowException" value="0"/>
<param name="MaxImagesInBuffer" value="1"/>
<param name="TIFFCompressionType" value="0"/>
</object>

<br><br><br>
<input type="button" value="Scan" ID = "btnScan" onclick="return btnScan_onclick()"/>
<input type="button" value="Upload" ID = "btnUpload" onclick='return btnUpload_onclick()'/>
</table>
</form>

</p>
</body>
</html>

Note: The Dynamic Web TWAIN CLASSID, "E7DA7F8D-27AB-4EE9-8FC0-3FEC9ECFE758", is the CLASSID for full version of Dynamic Web TWAIN. The CLASSID for trial version is "FFC6F181-A5CF-4ec4-A441-093D7134FBF2".

SaveToFile.php:
<?
    $fileTempName = $_FILES['RemoteFile']['tmp_name'];
    $fileSize = $_FILES['RemoteFile']['size'];
    $fileName = $_FILES['RemoteFile']['name'];

    if (file_exists($fileName))
        $fWriteHandle = fopen($fileName, 'w');
    else
        $fWriteHandle = fopen($fileName, 'x');

    $fReadHandle = fopen($fileTempName, 'rb');

    $fileContent = fread($fReadHandle, $fileSize);

    fwrite($fWriteHandle, $fileContent);

    fclose($fWriteHandle);
?>


Method HTTPUploadThroughPostEx

HTTPUploadThroughPostEx Method

Description

Uploads the image of a specified index in buffer to the HTTP server as a specified image format through HTTP POST method.

Syntax

Boolean ObjectName. HTTPUploadThroughPostEx(String HTTPServer, Short sImageIndex, String ActionPage, String FileName, Long ImageType)

Parameters

String HTTPServer: the name of the HTTP server.

Short sImageIndex: specifies the index of image in buffer. The index is 0-based.

String ActionPage: the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". This is the page corresponds to the action in <form> html tag: <form id = "frmSample" action = "upload.asp" method = post>...</form>

String FileName: the name of the image to be uploaded.

Long ImageType: the image format of the file to be created on the HTTP server.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

Dynamic Web TWAIN processes the image format according to the value of the ImageType.

Allowed Values | ImageType
0 | BMP
1 | JPEG
2 | TIFF
3 | PNG
4 | PDF

The field name of the uploaded image is RemoteFile.

IMPORTANT: 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, even the "<HTML>".

See also

FTPUserName property, FTPPassword property, FTPPort property, ProxyServer property, FTPDownloadEx(), HTTPPort property, HTTPUserName property, HTTPPassword property, HTTPDownloadEx(), HTTPUploadThroughPutEx(), HTTPUploadThroughPostEx()

Sample

A simple JSP sample is provided. Should you need sample in other languages, please access the following page to download samples.
https://www.dynamsoft.com/Secure/RegisterInfo_sample.aspx

JSP Sample:

Scan.jsp:
<%@ page language="java"%>
<html>
<head>
<title>Begin to scan -- demo of Dynamic Web TWAIN</title>

<script language="javascript">
function btnScan_onclick()
{
frmScan.DynamicWebTwain1.SelectSource();
frmScan.DynamicWebTwain1.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.jsp"; //the ActionPage's file path

frmScan.DynamicWebTwain1.HTTPPort = 80;
frmScan.DynamicWebTwain1.HTTPUploadThroughPostEx("127.0.0.1", 0, strActionPage, "imageData", 1);

if (frmScan.DynamicWebTwain1.ErrorCode != 0)
//alert(frmScan.DynamicWebTwain1.ErrorString);
alert(frmScan.DynamicWebTwain1.HTTPPostResponseString);
else //succeded
frmScan.submit();
}
</script>

</head>
<body MS_POSITIONING="GridLayout">
<object classid = "clsid:5220cb21-c88d-11cf-b347-00aa00a28331" VIEWASTEXT>
<param name="LPKPath" value="DynamicWebTwain.lpk"/>
</object>
<form id="frmScan" action="ShowResult.html">
<TABLE width="100%">
<tr>
<td>
<center>
<object classid="clsid:FFC6F181-A5CF-4EC4-A441-093D7134FBF2" id="DynamicWebTwain1" width="250" height="350"
CodeBase = "DynamicWebTWAIN.cab#version=5,0">
<param name="_cx" value="847"/>
<param name="_cy" value="847"/>
<param name="JpgQuality" value="80"/>
<param name="Manufacturer" value="Dynamsoft Corporation"/>
<param name="ProductFamily" value="Dynamic Web TWAIN"/>
<param name="ProductName" value="Dynamic Web TWAIN"/>
<param name="VersionInfo" value="Dynamic Web TWAIN 5.0"/>
<param name="TransferMode" value="0"/>
<param name="BorderStyle" value="0"/>
<param name="FTPUserName" />
<param name="FTPPassword" />
<param name="FTPPort" value="21"/>
<param name="HTTPUserName" />
<param name="HTTPPassword" />
<param name="HTTPPort" value="80"/>
<param name="ProxyServer" />
<param name="IfDisableSourceAfterAcquire" value="0"/>
<param name="IfShowUI" value="-1"/>
<param name="IfModalUI" value="-1"/>
<param name="IfTiffMultiPage" value="0"/>
<param name="IfThrowException" value="0"/>
<param name="MaxImagesInBuffer" value="1"/>
<param name="TIFFCompressionType" value="0"/>
<param name="IfFitWindow" value="-1"/>
</object>
</center>
</td>
</tr>
<tr>
<td>
<center>
<input id="btnScan" style="WIDTH: 100;HEIGHT: 30" onclick="return btnScan_onclick()" type="button" value="Scan"/>
<input style="WIDTH: 100;HEIGHT: 30" onclick="return btnUpload_onclick()" type="button" value="Upload"/>
</center>
</td>
</tr>
</table>
</form>
</body>
</html>

Note: The Dynamic Web TWAIN CLASSID, "E7DA7F8D-27AB-4EE9-8FC0-3FEC9ECFE758", is the CLASSID for full version of Dynamic Web TWAIN. The CLASSID for trial version is "FFC6F181-A5CF-4ec4-A441-093D7134FBF2".

SaveToFile.jsp:
<%@ page language="java" import="java.io.*"%>
<%
String contentType = request.getContentType();

if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0))
{
DataInputStream in = new DataInputStream(request.getInputStream());
int formDataLength = request.getContentLength();
byte dataBytes[] = new byte[formDataLength];
int byteRead = 0;
int totalBytesRead = 0;

while (totalBytesRead < formDataLength)
{
byteRead = in.read(dataBytes, totalBytesRead, formDataLength);
totalBytesRead += byteRead;
}

in.close();

String file = new String(dataBytes);
String saveFile = file.substring(file.indexOf("filename=\"") + 10);
saveFile = saveFile.substring(0, saveFile.indexOf("\n"));
saveFile = saveFile.substring(saveFile.lastIndexOf("\\") + 1,saveFile.indexOf("\""));

int lastIndex = contentType.lastIndexOf("=");
String boundary = contentType.substring(lastIndex + 1, contentType.length());
int pos;

pos = file.indexOf("filename=\"");
pos = file.indexOf("\n", pos) + 1;
pos = file.indexOf("\n", pos) + 1;
pos = file.indexOf("\n", pos) + 1;

int boundaryLocation = file.indexOf(boundary, pos) - 4;
int startPos = ((file.substring(0, pos)).getBytes()).length;
int endPos = ((file.substring(0, boundaryLocation)).getBytes()).length;

File fileToRecv = new File(application.getRealPath("/") + saveFile);

if(!fileToRecv.exists())
{
fileToRecv.createNewFile();
}
FileOutputStream fileOut = new FileOutputStream(fileToRecv);

fileOut.write(dataBytes, startPos, (endPos - startPos));

fileOut.flush();
fileOut.close();
}
%>


Method HTTPUploadThroughPut

HTTPUploadThroughPut Method

Description

Uploads the image of a specified index in buffer to the HTTP server through HTTP PUT method.

Syntax

Boolean ObjectName. HTTPUploadThroughPut(String HTTPServer, Short sImageIndex, String HTTPRemoteFile)

Parameters

String HTTPServer: the name of the HTTP server.

Short sImageIndex: specifies the index of image in buffer. The index is 0-based.

String HTTPRemoteFile: the name of the image to be created on the HTTP server.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

Dynamic Web TWAIN processes the image format according to the extension of the HTTPRemoteFile.

Dynamic Web TWAIN supports the following types of image files:

Bitmap | *.bmp, *.dib
JPEG | *.JPG, *.JPEG, .*.JPE, *.JFIF
TIFF | *.TIF, *.TIFF
PNG | *.PNG

HTTPRemoteFile parameter should include the HTTP directory of the file.

Write permission of the specified directory is needed for uploading.

See also

FTPUserName property, FTPPassword property, FTPPort property, ProxyServer property, FTPDownload(), FTPUpload(), HTTPPort property, IfSSL property, HTTPUserName property, HTTPPassword property, HTTPDownload(),, HTTPUploadThroughPost()


Method HTTPUploadThroughPutEx

HTTPUploadThroughPutEx Method

Description

Uploads the image of a specified index in buffer to the HTTP server as a specified image format through HTTP PUT method.

Syntax

Boolean ObjectName. HTTPUploadThroughPutEx(String HTTPServer, Short sImageIndex, String HTTPRemoteFile, Long ImageType)

Parameters

String HTTPServer: the name of the HTTP server.

Short sImageIndex: specifies the index of image in buffer. The index is 0-based.

String HTTPRemoteFile: the name of the file to be created on the HTTP server.

Long ImageType: the image format of the file to be created on the HTTP server.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

Dynamic Web TWAIN processes the image format according to the value of the ImageType.

Allowed Values | ImageType
0 | BMP
1 | JPEG
2 | TIFF
3 | PNG
4 | PDF

HTTPRemoteFile parameter should include the HTTP directory of the file.

Write permission of the specified directory is needed for uploading.

See also

FTPUserName property, FTPPassword property, FTPPort property, ProxyServer property, FTPDownloadEx(), HTTPPort property, HTTPUserName property, HTTPPassword property, HTTPDownloadEx(), HTTPUploadThroughPut(), HTTPUploadThroughPostEx()


Method HTTPUploadAllThroughPosttAsMultiPageTIFF

HTTPUploadAllThroughPostAsMultiPageTIFF Method

Description

Uploads all images in buffer to the HTTP server through HTTP Post method as Multi-Page TIFF.

Syntax

Boolean ObjectName. HTTPUploadAllThroughPostAsMultiPageTIFF(String HTTPServer, String ActionPage, String FileName)

Parameters

String HTTPServer: the name of the HTTP server.

String ActionPage: the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". This is the page corresponds to the action in <form> html tag: <form id = "frmSample" action = "upload.asp" method = post>...</form>

String FileName: the name of the image to be uploaded.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

The field name of the uploaded image is RemoteFile.

IMPORTANT: 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, even the "<HTML>".

See also

FTPUserName property, FTPPassword property, FTPPort property, ProxyServer property, FTPDownload(), FTPUpload(), HTTPPort property, IfSSL property, HTTPUserName property, HTTPPassword property, HTTPDownload(),, HTTPUploadThroughPost(), HTTPUploadThroughPut(), HTTPUploadAllThroughPutAsMultiPageTIFF(), FTPUploadAllAsMultiPageTIFF()

Sample

A simple ASP.NET (C#) sample is provided. Should you need sample in other languages, please access the following page to download samples.
https://www.dynamsoft.com/Secure/RegisterInfo_sample.aspx

ASP.NET (C#) Sample:

Snippet in Scan.aspx:
...

<script language="javascript">
function btnScan_onclick()
{
frmScan.DynamicWebTwain1.SelectSource();
frmScan.DynamicWebTwain1.OpenSource();
frmScan.DynamicWebTwain1.MaxImagesInBuffer = 2; //Trial version can only hold 2 images in buffer
frmScan.DynamicWebTwain1.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

frmScan.DynamicWebTwain1.HTTPPort = 80;
frmScan.DynamicWebTwain1.HTTPUploadAllThroughPostAsMultiPageTIFF(strHostIP,strActionPage,"imageData.tif");

if (frmScan.DynamicWebTwain1.ErrorCode != 0)
alert(frmScan.DynamicWebTwain1.ErrorString);
else //succeded
frmScan.submit();
alert("Upload successfully");
}
</script>

...

SaveToFile.aspx:
<%@ Page Language="c#" AutoEventWireup="false" Debug="True"%>

<%
HttpFileCollection files = HttpContext.Current.Request.Files;
HttpPostedFile uploadfile = files["RemoteFile"];
uploadfile.SaveAs(System.Web.HttpContext.Current.Request.MapPath(".") + "/" + uploadfile.FileName);
%>


Method HTTPUploadAllThroughPostAsPDF

HTTPUploadAllThroughPostAsPDF Method

Description

Uploads all images in buffer to the HTTP server through HTTP Post method as Multi-Page PDF.

Syntax

Boolean ObjectName. HTTPUploadAllThroughPostAsPDF(String HTTPServer, String ActionPage, String FileName)

Parameters

String HTTPServer: the name of the HTTP server.

String ActionPage: the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". This is the page corresponds to the action in <form> html tag: <form id = "frmSample" action = "upload.asp" method = post>...</form>

String FileName: the name of the image to be uploaded.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

The field name of the uploaded image is RemoteFile.

IMPORTANT: 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, even the "<HTML>".

See also

FTPUserName property, FTPPassword property, FTPPort property, ProxyServer property, FTPDownload(), FTPUpload(), HTTPPort property, IfSSL property, HTTPUserName property, HTTPPassword property, HTTPDownload(),, HTTPUploadThroughPost(), HTTPUploadThroughPut(), HTTPUploadAllThroughPutAsPDF(), FTPUploadAllAsPDF()

Sample

A simple ASP.NET (VB.NET) sample is provided. Should you need sample in other languages, please access the following page to download samples.
https://www.dynamsoft.com/Secure/RegisterInfo_sample.aspx

ASP.NET (VB.NET) Sample:

Snippet in Scan.aspx:
...

<script language="javascript">
function btnScan_onclick()
{
frmScan.DynamicWebTwain1.SelectSource();
frmScan.DynamicWebTwain1.OpenSource();
frmScan.DynamicWebTwain1.MaxImagesInBuffer = 2; //Trial version can only hold 2 images in buffer
frmScan.DynamicWebTwain1.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

frmScan.DynamicWebTwain1.HTTPPort = 80;
frmScan.DynamicWebTwain1.HTTPUploadAllThroughPostAsPDF(strHostIP,strActionPage,"imageData.pdf");

if (frmScan.DynamicWebTwain1.ErrorCode != 0)
alert(frmScan.DynamicWebTwain1.ErrorString);
else //succeded
frmScan.submit();
alert("Upload successfully");
}
</script>

...

SaveToFile.aspx:
<%@ Page Language="vb" AutoEventWireup="false"%>
<%
Dim files As HttpFileCollection = HttpContext.Current.Request.Files
Dim uploadfile As HttpPostedFile = files("RemoteFile")

dim filePath
filePath = System.Web.HttpContext.Current.Request.MapPath(".") & "/" & uploadfile.FileName

uploadfile.SaveAs(filePath)
%>


Method HTTPUploadAllThroughPutAsMultiPageTIFF

HTTPUploadAllThroughPutAsMultiPageTIFF Method

Description

Uploads all images in buffer to the HTTP server through HTTP Put method as Multi-Page TIFF.

Syntax

Boolean ObjectName. HTTPUploadAllThroughPutAsMultiPageTIFF(String HTTPServer, String FileName)

Parameters

String HTTPServer: the name of the HTTP server.

String FileName: the name of the image to be uploaded.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

None.

See also

FTPUserName property, FTPPassword property, FTPPort property, ProxyServer property, FTPDownload(), FTPUpload(), HTTPPort property, IfSSL property, HTTPUserName property, HTTPPassword property, HTTPDownload(),, HTTPUploadThroughPost(), HTTPUploadThroughPut(), HTTPUploadAllThroughPostAsMultiPageTIFF(), FTPUploadAllAsMultiPageTIFF()


Method HTTPUploadAllThroughPutAsPDF

HTTPUploadAllThroughPutAsPDF Method

Description

Uploads all images in buffer to the HTTP server through HTTP Put method as Multi-Page PDF.

Syntax

Boolean ObjectName. HTTPUploadAllThroughPutAsPDF(String HTTPServer, String FileName)

Parameters

String HTTPServer: the name of the HTTP server.

String FileName: the name of the image to be uploaded.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

None.

See also

FTPUserName property, FTPPassword property, FTPPort property, ProxyServer property, FTPDownload(), FTPUpload(), HTTPPort property, IfSSL property, HTTPUserName property, HTTPPassword property, HTTPDownload(),, HTTPUploadThroughPost(), HTTPUploadThroughPut(), HTTPUploadAllThroughPostAsPDF(), FTPUploadAllAsPDF()


Method LoadDibFromClipboard

LoadDibFromClipboard Method

Description

Loads a DIB format image from Clipboard into the Dynamic Web TWAIN.

Syntax

Boolean ObjectName. LoadDibFromClipboard()

Parameters

None.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

The loaded image will be displayed in the Dynamic Web TWAIN.

See Also

LoadImage(),
CopyToClipboard(),
CutToClipboard()


Method LoadImage

LoadImage

Description

Loads an image into the Dynamic Web TWAIN.

Syntax

Boolean ObjectName. LoadImage(String FileName)

Parameters

String FileName: the name of the image to be loaded.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

Dynamic Web TWAIN processes the image format according to the extension of the FileName.

Dynamic Web TWAIN supports the following types of image files:

Bitmap | *.bmp, *.dib
JPEG | *.JPG, *.JPEG, .*.JPE, *.JFIF
TIFF | *.TIF, *.TIFF
PNG | *.PNG

The loaded image will be displayed in the Dynamic Web TWAIN.

See also

FTPDownload(),
HTTPDownload(),
LoadDibFromClipboard(),
LoadImageEx()


Method FTPUpload

LoadImageEx Method

Description

Loads an image into the Dynamic Web TWAIN.

Syntax

Boolean ObjectName. LoadImageEx(String FileName, Long ImageType)

Parameters

String FileName: the name of the image to be loaded.

Long ImageType: the image format of the file to be loaded.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

Dynamic Web TWAIN processes the image format according to the value of the ImageType.

Allowed Values | ImageType
0 | BMP
1 | JPEG
2 | TIFF
3 | PNG
4 | PDF

The loaded image will be displayed in the Dynamic Web TWAIN.

See also

FTPDownload(),
HTTPDownload(),
LoadDibFromClipboard(),
LoadImage()


Method Mirror

Mirror Method

Description

Mirrors the image of a specified index in buffer.

Syntax

Boolean ObjectName. Mirror(Short sImageIndex)

Parameters

Short sImageIndex: specifies the index of image in buffer. The index is 0-based.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

Mirror() mirrors an image and replaces the original image with the mirrored copy.

See Also

RotateLeft(),
RotateRight(),
Flip(), Crop(),
CropToClipboard(),
GetImageSize(),
ChangeImageSize(),
ShowImageEditor(),
ImageEditorWindowTitle property,
ImageEditorIfReadonly property,
ImageEditorIfEnableEnumerator
property


Method OpenSource

OpenSource Method

Description

Loads the specified Source into main memory and causes its initialization, placing Dynamic (Web) TWAIN into Capability Negotiation state. If no source is specified (no SelectSource() or SelectSourceByIndex() is called), opens the default source.

Syntax

Boolean ObjectName. OpenSource()

Parameters

None.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

OpenSource() should be called prior to negotiating capability.

If no source selection function is called before OpenSource(), OpenSource() opens the default source.

See also

CloseSource(),
OpenSourceManager(),
SelectSource(),
SelectSourceByIndex(),
How to Negotiate Capability with Different Capability Container Types.


Method OpenSourceManager

OpenSourceManager Method

Description

Loads and opens Data Source Manager.

Syntax

Boolean ObjectName. OpenSourceManager()

Parameters

None.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

If application identification information needs to be set, it should be set before OpenSourceManager().

Dynamic (Web) TWAIN has built-in Wizard Mode. With Wizard Mode, OpenSourceManager() can be called intelligently by other functions, such as EnableSource() or SelectSource(), if necessary.

OpenSourceManager() populates SourceNameItems property with a list of installed sources. SourceNameItems property along with other properties and methods can be used to customize source selection interface.

See also

AcquireImage(),
CloseSourceManager(),
EnableSource(),
OpenSource(),
SelectSource(),
TWAIN state transition.


Method ResetImageLayout

ResetImageLayout Method

Description

Reverts the current image layout to the Data Source’s default.

Syntax

Boolean ObjectName. ResetImageLayout()

Parameters

None.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

None.

See also

GetDefaultImageLayout(), GetImageLayout(), SetImageLayout()


Method RewindPage

RewindPage Method

Description

Sets the Source to return the current page to the input side of the document feeder and feed the last page from the outside of the feeder back into the acquisition area if IfFeederEnabled is TRUE.

Syntax

Boolean ObjectName. RewindPage()

Parameters

None.

Return value

Boolean

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

Using this property after opening the Data Source (see OpenSource() method) and checking if the value of IfFeederEnabled property is TRUE.

See also

IfFeederEnabled property, IfAutoFeed property


Method RemoveAllImages

RemoveAllImages Method

Description

Removes all images in buffer.

Syntax

void ObjectName.RemoveAllImages()

Parameters

None.

Return value

Void.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

Remarks

None.

See also

RemoveImage()


Method RemoveImage

RemoveImage Method

Description

Removes the image of a specified index in buffer.

Syntax

Boolean ObjectName.RemoveImage(Short sImageIndexToBeDeleted)

Parameters

Short sImageIndexToBeDeleted: specifies the index of the image to be deleted in buffer. The index is 0-based.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

None.

See also

RemoveAllImages(), CurrentImageIndexInBuffer property, HowManyImagesInBuffer property, MaxImagesInBuffer property

Sample

The following sample shows how to remove the current image from buffer:.

VB Sample:
Private Sub RemoveCurrentImage()

    Twain.RemoveImage(Twain.CurrentImageIndexInBuffer)

End Sub


Method RotateLeft

RotateLeft Method

Description

Rotates the image of a specified index in buffer by 90 degrees counter-clockwise.

Syntax

Boolean ObjectName. RotateLeft(Short sImageIndex)

Parameters

Short sImageIndex: specifies the index of image in buffer. The index is 0-based.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

RotateLeft() rotates an image and replaces the original image with the rotated copy.

See Also

RotateRight(),
Flip(), Mirror(),
Crop(),
CropToClipboard(), GetImageSize(),
ChangeImageSize(),
ShowImageEditor(),
ImageEditorWindowTitle property,
ImageEditorIfReadonly property,
ImageEditorIfEnableEnumerator
property

Samples

Rotate an image in the control.


Method RotateRight

RotateRight Method

Description

Rotates the image of a specified index in buffer by 90 degrees clockwise.

Syntax

Boolean ObjectName. RotateRight(Short sImageIndex)

Parameters

Short sImageIndex: specifies the index of image in buffer. The index is 0-based.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

RotateLeft() rotates an image and replaces the original image with the rotated copy.

See Also

RotateLeft(),
Flip(), Mirror(),
Crop(),
CropToClipboard(), GetImageSize(),
ChangeImageSize(),
ShowImageEditor(),
ImageEditorWindowTitle property,
ImageEditorIfReadonly property,
ImageEditorIfEnableEnumerator
property

Samples

Rotate an image in the control.


Method SaveAsBMP

SaveAsBMP Method

Description

Saves the image of a specified index in buffer as a BMP file.

Syntax

Boolean ObjectName. SaveAsBMP(String FileName, Short sImageIndex)

Parameters

String FileName: the name of the BMP file to be saved.

Short sImageIndex: specifies the index of image in buffer. The index is 0-based.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

None.

See also

SaveAsJPEG(),
SaveAsTIFF(),
SaveAsPNG(),
SaveAllAsMultiPageTIFF(),
FTPUpload(),
FTPDownload(),
HTTPUploadThroughPut(),
HTTPUploadThroughPost(),
HTTPDownload()

Samples

Save new acquired image as a BMP file automatically after a transfer ends.

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


Method SaveAllAsMultiPageTiff

SaveAllAsMultiPageTIFF Method

Description

Saves all images in buffer as a MultiPage TIFF file.

Syntax

Boolean ObjectName. SaveAllAsMultiPageTIFF(String FileName)

Parameters

String FileName: the name of the MultiPage TIFF file to be saved.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

Multi-Page TIFF is a built-in feature of Dynamic Web TWAIN, no other DLLs are required.

See also

SaveAsTIFF(), SaveAsJPEG(),
SaveAsBMP(),
SaveAsPNG(),
FTPUpload(),
FTPDownload(),
HTTPUploadThroughPut(),
HTTPUploadThroughPost(),
HTTPDownload()


Method SaveAllAsPDF

SaveAllAsPDF Method

Description

Saves all images in buffer as a Multi-Page PDF file.

Syntax

Boolean ObjectName. SaveAllAsPDF(String FileName)

Parameters

String FileName: the name of the Multi-Page PDF file to be saved.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

Multi-Page PDF is a built-in feature of Dynamic Web TWAIN, no other DLLs are required.

See also

PDFTitle property, PDFAuthor property, PDFSubject property, PDFKeywords property, PDFCreationDate property, PDFModifiedDate property, PDFCreator property, PDFProducer property, SaveAsPDF(), FTPUploadAllAsPDF(), HTTPUploadAllThroughPostAsPDF(), HTTPUploadAllThroughPutAsPDF(), FTPUpload(), FTPDownload(), HTTPUploadThroughPut(), HTTPUploadThroughPost(), HTTPDownload()


Method SaveAsPDF

SaveAsPDF Method

Description

Saves the image of a specified index in buffer as a PDF file.

Syntax

Boolean ObjectName. SaveAsPDF(String FileName, Short sImageIndex)

Parameters

String FileName: the name of the PDF file to be saved.

Short sImageIndex: specifies the index of image in buffer. The index is 0-based.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

PDF is a built-in feature of Dynamic Web TWAIN, no other DLLs are required.

This method can not add a new acquired image into an existing PDF file. If you want to save all the acquired images in a Multi-Page PDF file, please use the SaveAllAsPDF method.

See also

PDFTitle property, PDFAuthor property, PDFSubject property, PDFKeywords property, PDFCreationDate property, PDFModifiedDate property, PDFCreator property, PDFProducer property, SaveAllAsPDF(), FTPUploadAllAsPDF(), HTTPUploadAllThroughPostAsPDF(), HTTPUploadAllThroughPutAsPDF(), HTTPUploadThroughPut(), HTTPUploadThroughPost(), FTPUpload()

Samples

Save each document in a separate PDF file.

VB Sample:
Dim iDocumentCounter As Integer
iDocumentCounter = 0 'Set initialize value

Private Sub BeginScan()
    Twain.OpenSource
    Twain.IfShowUI = False
    Twain.IfDisableSourceAfterAcquire = True

    Twain.IfFeederEnabled = True
    Twain.XferCount = -1
    Twain.IfAutoFeed = True 'Auto feed

    Twain.AcquireImage
End Sub

Private Sub Twain_OnPosttransfer()
    iDocumentCounter = iDocumentCounter + 1

    If Twain.SaveAsPDF("c:\Image\" + Str(iDocumentCounter) + ".pdf", 0) = False Then
        MsgBox Twain.ErrorString
    End If
End Sub


Method SaveAsPNG

SaveAsPNG Method

Description

Saves the image of a specified index in buffer as a PNG file.

Syntax

Boolean ObjectName. SaveAsPNG(String FileName, Short sImageIndex)

Parameters

String FileName: the name of the PNG file to be saved.

Short sImageIndex: specifies the index of image in buffer. The index is 0-based.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

None.

See also

SaveAsJPEG(),
SaveAsTIFF(),
SaveAsBMP(),
SaveAllAsMultiPageTIFF(),
FTPUpload(),
FTPDownload(),
HTTPUploadThroughPut(),
HTTPUploadThroughPost(),
HTTPDownload()

Samples

Save new acquired image as a PNG file automatically after a transfer ends.

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.SaveAsPNG "C:\SaveAsPNG.png", 0
End Sub


Method SaveAsJPEG

SaveAsJPEG Method

Description

Saves the image of a specified index in buffer as a JPEG file.

Syntax

Boolean ObjectName. SaveAsJPEG(String FileName, Short sImageIndex)

Parameters

String FileName: the name of the JPEG file to be saved.

Short sImageIndex: specifies the index of image in buffer. The index is 0-based.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

JPEG compression is a built-in feature of Dynamic Web TWAIN, no other DLLs are required.

JPEG standard defines that only 256 gray-scaled image and 24 bit RGB image can be compressed as JPEG format.

See also

JPEGQuality property,
SaveAsBMP(),
SaveAsTIFF(),
SaveAsPNG(),
SaveAllAsMultiPageTIFF(),
FTPUpload(),
FTPDownload(),
HTTPUploadThroughPut(),
HTTPUploadThroughPost(),
HTTPDownload()

Samples

Save new acquired image as a JPEG file automatically after a transfer ends.

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.SaveAsJPEG "C:\SaveAsJPEG.jpg", 0
End Sub


Method SaveAsTIFF

SaveAsTIFF Method

Description

Saves the image of a specified index in buffer as a TIFF file.

Syntax

Boolean ObjectName. SaveAsTIFF(String FileName, Short sImageIndex)

Parameters

String FileName: the name of the TIFF file to be saved.

Short sImageIndex: specifies the index of image in buffer. The index is 0-based.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

TIFF is a built-in feature of Dynamic Web TWAIN, no other DLLs are required.

See also

IfTIFFMultiPage property,
TIFFCompressionType property,
SaveAsJPEG(),
SaveAsBMP(),
SaveAsPNG(),
SaveAllAsMultiPageTIFF(),
HTTPUploadThroughPut(),
HTTPUploadThroughPost(),
FTPUpload()

Samples

Save acquired images as a Multi-Page TIFF file.

VB Sample:
Private Sub Scan_Click()
    Twain.OpenSource
    Twain.IfShowUI = False    'Set without user interface
    Twain.IfDisableSourceAfterAcquire = True
    Twain.AcquireImage
End Sub

Private Sub Twain_OnPostTransfer()
    Twain.IfTiffMultiPage = True   'Save as multi-page TIFF
    Twain.SaveAsTIFF "C:\SaveAsTIFF.tif", 0

    If (Twain.ErrorCode <> 0) Then
        MsgBox (Twain.ErrorString)
    Else 'succeded
        MsgBox ("Successful")
    End If
End Sub

Save each document in a separate TIFF file.


Method SelectSource

SelectSource Method

Description

Brings up the TWAIN Data Source Manager's Source Selection User Interface (UI) so that user can choose which Data Source to be the current Source.

Syntax

Boolean ObjectName. SelectSource()

Parameters

None.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

None.

See also

SelectSourceByIndex()


Method SelectSourceByIndex

SelectSourceByIndex Method

Description

Selects the index-the source in SourceNameItems property as the current source.

Syntax

Boolean ObjectName. SelectSourceByIndex(Long index)

Parameters

Long index. It is the index of SourceNameItems property.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

The index is 0-based.

See also

SourceCount propeprty, SelectSource(), SourceNameItems property

Samples

Select necessary device without device selection dialog.


Method SetFileXferInfo

SetFileXFERInfo Method

Description

Sets file name and file format information used in File Transfer Mode.

Syntax

Boolean ObjectName. SetFileXFERInfo(String FileName, enumTW_FILEFORMAT FileFormat)

Parameters

String FileName: the name of the file to be used in transfer.

enumTW_FILEFORMAT FileFormat: a enumerated values indicates the format of the image.

The followings are the allowed formats: TWFF_TIFF(0), TWFF_PICT(1), TWFF_BMP(2), TWFF_XBM(3), TWFF_JFIF(4), TWFF_FPX(5), TWFF_TIFFMULTI(6), TWFF_PNG(7), TWFF_SPIFF(8), TWFF_EXIF( 9)

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

The SetFileXFERInfo() is valid only in File Transfer Mode.

Before using any file format, negotiate ICAP_IMAGEFILEFORMAT capability to make sure if the Source can handle the desired image format.

In File Transfer Mode, the image is transferred to the designated file directly and there is no image in Dynamic (Web) TWAIN.

See also

TransferMode property


Method SetHTTPFormField

SetHTTPFormField Method

Description

Sets set a text parameters of a web form which is used for image uploading.

Syntax

Boolean ObjectName. SetHTTPFormField(String FieldName, String FieldValue)

Parameters

String FieldName: specifies the name of a text field in web form.

String FieldValue: specifies the value of a text field in web form.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

None.

See also

ClearAllHTTPFormFiled(), ImageMargin property, MouseShape property


Method SetImageLayout

SetImageLayout Method

Description

Sets the left, top, right, and bottom sides of the image layout rectangle for the current Data Source.

Syntax

Boolean ObjectName. SetImageLayout(Float Left, Float Top, Float Right, Float Bottom)

Parameters

Float Left: specifies the floating point number for the left side of the image layout rectangle.

Float Top: specifies the floating point number for the top side of the image layout rectangle.

Float Right: specifies the floating point number for the right side of the image layout rectangle.

Float Bottom: specifies the floating point number for the bottom side of the image layout rectangle.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

The image layout rectangle defines what portion of the Data Source's scanning area is acquired.

See also

GetDefaultImageLayout(), GetImageLayout(), ResetImageLayout()


Method SetViewMode

SetViewMode Method

Description

Sets the view mode that images are displayed in Dynamic Web TWAIN. You can use this method to display multiple images in Dynamic Web TWAIN.

Syntax

Void ObjectName. SetViewMode(Short sHorizontalImageCount, Short sVerticalImageCount)

Parameters

Short sHorizontalImageCount: specifies how many columns can be displayed in Dynamic Web TWAIN.

Short sVerticalImageCount: specifies how many rows can be displayed in Dynamic Web TWAIN.

Return value

Void.

Remarks

The default is 1 by 1.

Screen shot when the view mode is set to 2 x 2.

See also

GetViewMode(), ImageMargin property, MouseShape property


Properties

Categorical list of all the properties and methods:

Application Identity Group
Capability Negotiation Group
Data Source Operating Group
General Purpose Group
Image Editor Group
Image Information Group
Web Group

If you do NOT want to read this documentation or spend any time in TWAIN, please click here.

Application Identity Group

Manufacturer Property
ProductFamily Property
ProductName Property
VersionInfo Property

Capability Negotiation Group

Capability Property
CapCurrentIndex Property
CapCurrentValue Property
CapDefaultIndex Property
CapDefaultValue Property
CapDescription Property
CapItems Property
CapItemsString Property
CapMaxValue Property
CapMinValue Property
CapNumItems Property
CapStepSize Property
CapType Property
CapValue Property
CapValueString Property

IfAutoBright Property
IfAutoFeed Property
IfThrowException Property
IfTiffMultiPage Property
Brightness Property
Contrast Property
Duplex Property
IfDuplexEnabled Property
IfFeederEnabled Property
IfFeederLoaded Property
IfPaperDetectable Property
PageSize Property
BitDepth Property
PixelType Property
Unit Property
Resolution Property
PixelFlavor Property
IfAutoScan Property
IfDeviceOnline Property
IfShowIndicator Property
IfUIControllable Property
XferCount Property

Web Group

FTPPassword Property
FTPPort Property
FTPUserName Property
HTTPPassword Property
HTTPPort Property
HTTPUserName Property
HTTPPostResponseString Property
IfShowCancelDialogWhenImageTransfer Property
IfSSL Property
ProxyServer Property

Data Source Operating Group

CurrentSourceName Property
DefaultSourceName Property
SourceCount Property
SourceNameItems Property

DataSourceStatus Property
IfDisableSourceAfterAcquire Property
IfShowUI Property
IfModalUI Property

General Purpose Group

BorderStyle Property
ErrorCode Property
ErrorString Property
hDIB Property
IfFitWindow Property
ImageMargin Property
JPEGQuality Property
MouseShape Property
PendingXfers Property
Picture Property
TransferMode Property

MaxImagesInBuffer Property
HowManyImagesInBuffer Property
CurrentImageIndexInBuffer Property
TiffCompressionType Property

PDFCompressionType Property
PDFAuthor Property
PDFCreationDate Property
PDFCreator Property
PDFKeywords Property
PDFModifiedDate Property
PDFProducer Property
PDFSubject Property
PDFTitle Property

Image Editor Group

ImageEditorWindowTitle Property
ImageEditorIfReadonly Property
ImageEditorIfEnableEnumerator Property

Image Information Group

ImageBitsPerPixel Property
ImageLayoutDocumentNumber Property
ImageLayoutFrameBottom Property
ImageLayoutFrameLeft Property
ImageLayoutFrameNumber Property
ImageLayoutFrameRight Property
ImageLayoutFrameTop Property
ImageLayoutPageNumber Property
ImageLength Property
ImagePixelType Property
ImageWidth Property
ImageXResolution Property
ImageYResolution Property


Property BitDepth

BitDepth Property

Description

Returns or sets the pixel bit depths for the current value of PixelType property. This is a runtime property.

Data type

short

Syntax

ObjectName. BitDepth

Remarks

Using this property after calling OpenSource() method and before calling AcquireImage().

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

PixelType property


Property BorderStyle

BorderStyle

Description

Sets or returns the border style.

Data type

Enumerated Value/Integer

Value | Description
None (0) | No border.
SingleFlat (1) | Flat border.
Single3D (2) | 3D border.

Syntax

ObjectName. BorderStyle

Remarks

The default value of the BorderStyle property is None (0).

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.


Property Brightness

Brightness Property

Description

Returns or sets the brightness values available within the Source. This is a runtime property.

Data type

float

Syntax

ObjectName. Brightness

Remarks

Using this property after calling OpenSource() method and before calling AcquireImage().

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

IfAutoBright property, Contrast property


Property Capability

Capability Property

Description

Specifies the capabiltiy to be negotiated. This is a runtime property.

Data type

Enumerated value / Integer

Syntax

ObjectName. Capability

Remarks

Prior to negotiating capability, OpenSource() needs to be called to make Dynamic (Web) TWAIN ready for capability negotiation.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

How to Negotiate Capability with Different Capability Container Types,
 CapGet(),
CapGetCurrent(),
CapGetDefault(),
CapReset(), CapSet(),
CapType
Property, OpenSource()

Samples

VB Sample:
Twain.OpenSource

Twain.Capability = ICAP_UNITS
Twain.CapType = TWON_ONEVALUE
Twain.CapValue = 0        'TWUN_INCHES

If Twain.CapSet = True Then
    MsgBox "Successful."
Else
    MsgBox "Failed." + vbCrLf + Twain.ErrorString, vbCritical + vbOKOnly
End If

JavaScript Sample:
frmSample.WebTwain.OpenSource();

frmSample.WebTwain.Capability = 0x0102;    //ICAP_BRIGHTNESS
frmSample.WebTwain.CapType = 5;            //TWON_ONEVALUE
frmSample.WebTwain.CapValue = 0;           //TWUN_INCHES

if (frmSample.WebTwain1.CapSet() == true)
   alert("Successful.");
else
   alert(frmSample.WebTwain1.ErrorString);


Property CapCurrentIndex

CapCurrentIndex Property

Description

Sets or returns the index (0-based) of a list to indicate the Current Value when the value of the CapType property is TWON_ENUMERATION. If the data type of the capability is String, the list is in CapItemsString property. For other data types, the list is in CapItems property. This is a runtime property.

Data type

Long

Syntax

ObjectName. CapCurrentIndex

Remarks

Reading this property after calling CapGet() method. After setting this property, call CapSet() method to actually set the value.

The CapCurrentIndex property is 0-based.

It is valid only when the CapType property is TWON_ENUMERATION.

For information of which properties are valid for different container types, please refer to CapType property.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

Capability property, CapDefaultIndex property, CapItems property, CapItemsString property, CapNumItems property, CapType property

Sample code

Refer to Setting Capability with TW_ENUMERATION, Reading Value(s) from Capability Negotiation.


Property CapCurrentValue

CapCurrentValue Property

Description

Sets or returns the current value in a range when the value of the CapType property is TWON_RANGE. This is a runtime property.

Data type

Double

Syntax

ObjectName. CapCurrentValue

Remarks

Reading this property after calling CapGet() method. After setting this property, call CapSet() method to actually set the value.

CapCurrentValue property is valid only when the value of the CapType property is TWON_RANGE.

For information of which properties are valid for different container types, please refer to CapType property.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

Capability Property, CapDefaultValue property, CapMaxValue property, CapMinValue property, CapStepSize property, CapType property

Sample

Refer to Setting Capability with TW_RANGE, Reading Value(s) from Capability Negotiation.


Property CapDefaultIndex

CapDefaultIndex Property

Description

Returns the index (0-based) of a list to indicate the Default Value when the value of the CapType property is TWON_ENUMERATION. If the data type of the capability is String, the list is in CapItemsString property. For other data types, the list is in CapItems property. This is a runtime, read-only property.

Data type

Long

Syntax

ObjectName. CapDefaultIndex

Remarks

Reading this property after calling CapGet() method.

The CapDefaultIndex property is 0-based and read-only.

It is valid only when the CapType property is TWON_ENUMERATION.

For information of which properties are valid for different container types, please refer to CapType property.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

Capability property, CapCurrentIndex property, CapItems property, CapItemsString property, CapNumItems property, CapType property

Sample code

Refer to Setting Capability with TW_ENUMERATION, Reading Value(s) from Capability Negotiation.


Property CapDefaultValue

CapDefaultValue Property

Description

Returns the default value in a range when the value of the CapType property is TWON_RANGE. This is a runtime, read-only property.

Data type

Double

Syntax

ObjectName. CapDefaultValue

Remarks

Reading this property after calling CapGet() method.

Default value reflects the source's power-on value. It can NOT be set.

CapDefaultValue property is valid only when the value of the CapType property is TWON_RANGE.

For information of which properties are valid for different container types, please refer to CapType property.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

Capability Property, CapCurrentValue property, CapMaxValue property, CapMinValue property, CapStepSize property, CapType property

Sample

Refer to Setting Capability with TW_RANGE.


Property CapDescription

CapDescription Property

Description

Returns the description of a constant for the current capability. The current capability is specified in Capability property. This is a runtime, read-only property.

Data type

String

Syntax

ObjectName. CapDescription(Integer CapValue)

Remarks

This property has a parameter.

The return value of this property is useful for display purposes. For example, when the value of the Capability property is ICAP_UNITS, CapDescription(0) returns "INCHES".

If no description is found for the specified Capability property and CapValue parameter, "" is returned.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

Capability property


Property CapItems

CapItems Property

Description

Sets or returns a array of values of the capability specified by Capability property, when the value of the CapType property is TWON_ARRAY or TWON_ENUMERATION. This is a runtime property.

Data type

Double

Syntax

ObjectName. CapItems(long index)

Remarks

Reading this property after calling CapGet() method. After setting this property, call CapSet() method to actually set the value.

This property has a parameter. The data type of the parameter is Long and it is 0-based.

The Double type of CapItems property is used to present Double, Single(Float), Long, Integer and even Boolean types. For String type, please use CapItemsString property.

When using Double type for Boolean type, 1 denotes TRUE, 0 denotes FALSE. The constant True/False of Visual Basic can NOT be used.

This is very like CapValue property and CapValueString property, where CapValueString property is used to present String type and CapValue is used to present other types. CapValue property and CapValueString property are used when the container type is TWON_ONEVALUE.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

COM Data Type Mapping, Capability property, CapGet(), CapItemsString property, CapSet(), CapType property, CapValue property, CapValueString property

Sample code

Please refer to How to Negotiate Capability with Different Capability Container Types


Property CapItemsString

CapItemsString Property

Description

Sets or returns a array of values of the capability specified by Capability property, when the value of the CapType property is TWON_ARRAY or TWON_ENUMERATION. This is a runtime property.

Data type

String

Syntax

ObjectName. CapItemsString(long index)

Remarks

Reading this property after calling CapGet() method. After setting this property, call CapSet() method to actually set the value.

This property has a parameter. The data type of the parameter is Long and it is 0-based.

CapItemsString property is used to set or return String type values. For other data types, use CapItems property.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

COM Data Type Mapping, Capability property, CapGet(), CapItems property, CapSet(), CapType property, CapValue property, CapValueString property

Sample code

Please refer to How to Negotiate Capability with Different Capability Container Types.


Property CapMaxValue

CapMaxValue Property

Description

Sets or returns the maximum value in a range when the value of the CapType property is TWON_RANGE. This is a runtime property.

Data type

Double

Syntax

ObjectName. CapMaxValue

Remarks

Reading this property after calling CapGet() method. After setting this property, call CapSet() method to actually set the value.

CapMaxValue property is valid only when the value of the CapType property is TWON_RANGE.

For information of which properties are valid for different container types, please refer to CapType property.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

Capability Property, CapCurrentValue property, CapDefaultValue property, CapMinValue property, CapStepSize property, CapType property

Sample

Refer to Setting Capability with TW_RANGE.


Property CapMinValue

CapMinValue Property

Description

Sets or returns the minimum value in a range when the value of the CapType property is TWON_RANGE. This is a runtime property.

Data type

Double

Syntax

ObjectName. CapMinValue

Remarks

Reading this property after calling CapGet() method. After setting this property, call CapSet() method to actually set the value.

CapMinValue property is valid only when the value of the CapType property is TWON_RANGE.

For information of which properties are valid for different container types, please refer to CapType property.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

Capability Property, CapCurrentValue property, CapDefaultValue property, CapMaxValue property, CapStepSize property, CapType property

Sample

Refer to Setting Capability with TW_RANGE.


Property CapNumItems

CapNumItems Property

Description

Sets or returns how many items are in the list when the value of the CapType property is TWON_ARRAY or TWON_ENUMERATION. For String data type, the list is in CapItemsString property. For other data types, the list is in CapItems property. This is a runtime property.

Data type

Long

Syntax

ObjectName. CapNumItems

Remarks

Reading this property after calling CapGet() method. After setting this property, call CapSet() method to actually set the value.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

CapType property, CapItems property, CapItemsString property,

Sample

Refer to How to Negotiate Capability with Different Capability Container Types.


Property CapStepSize

CapStepSize Property

Description

Sets or returns the step size in a range when the value of the CapType property is TWON_RANGE. This is a runtime property.

Data type

Double

Syntax

ObjectName. CapStepSize

Remarks

Reading this property after calling CapGet() method. After setting this property, call CapSet() method to actually set the value.

CapStepSize property is valid only when the value of the CapType property is TWON_RANGE.

For information of which properties are valid for different container types, please refer to CapType property.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

Capability Property, CapCurrentValue property, CapDefaultValue property, CapMaxValue property, CapMinValue property, CapType property

Sample

Refer to Setting Capability with TW_RANGE.


Property CapType

CapType Property

Description

Sets or returns the type of capability container used to exchange capability information between application and source. This is a runtime property.

Data type

Enumerated value / Integer

Syntax

ObjectName. CapType

Value Description
TWON_ARRAY(3) A array of associated individual values.
CapNumItems property, CapItems property/CapItemsString property are valid.
TWON_ENUMERATION(4) A group of associated individual values. The values are ordered from the lowest to highest values, but the step size between every two values is probably not uniform.
CapNumItems property, CapCurrentIndex property, CapDefaultIndex property, CapItems property/CapItemsString property are valid.
TWON_ONEVALUE(5) A single value. CapValue property or CapValueString property is valid.
TWON_RANGE(6) A range of individual values.
CapMinValue property, CapMaxValue property, CapStepSize property, CapDefaultValue property and CapCurrentValue property are valid.

Remarks

CapType property does not need to be set before CapGet() is called.

CapDefaultIndex property and CapDefaultValue property reflect power-on values and are not available with CapSet().

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

Capability  property,
CapGet(), CapGetDefault(),
CapGetCurrent(),
CapSet()

Sample code

Refer to How to Negotiate Capability with Different Capability Container Types.


Property CapValue

CapValue Property

Description

Returns or sets the value of the capability specified by Capability property when the value of the CapType property is TWON_ONEVALUE. This is a runtime property.

Data type

Double

Syntax

ObjectName. CapValue

Remarks

Reading this property after calling CapGet() method. After setting this property, call CapSet() method to actually set the value.

The Double type of CapValue property is used to present Double, Single(Float), Long, Integer and even Boolean types. For String type, please use CapValueString property.

When using Double type for Boolean type, 1 denotes TRUE, 0 denotes FALSE. The constant True/False of Visual Basic can NOT be used.

This is very like CapItems property and CapItemsString property, where CapItemsString property is used to present String type and CapItems is used to present other types. CapItems property and CapItemsString property are used when the container type is TWON_ARRAY or TWON_ENUMERATION.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

COM Data Type Mapping, Capability property, CapGet(), CapItems property, CapItemsString property, CapSet(), CapType property, CapValueString property

Sample

Please refer to How to Negotiate Capability with Different Capability Container Types.


Property CapValueString

CapValueString Property

Description

Sets or returns the string value for a capability when the value of the CapType property is TWON_ONEVALUE. This is a runtime property.

Data type

String

Syntax

ObjectName. CapValueString

Remarks

Reading this property after calling CapGet() method. After setting this property, call CapSet() method to actually set the value.

CapValueString property is used to set or return String type value. For any other data types when the CapType property is TWON_ONEVALUE, use CapValue property.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

Com Data Type Mapping, Capability property, CapType property, CapValue property, TWON_ONEVALUE


Property Contrast

Contrast Property

Description

Returns or sets the contrast values available within the Source. This is a runtime property.

Data type

float

Syntax

ObjectName. Contrast

Remarks

Using this property after calling OpenSource() method and before calling AcquireImage().

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

Brightness property


Property CurrentImageIndexInBuffer

CurrentImageIndexInBuffer Property

Description

Returns or sets current index of image in buffer. This is a runtime property.

Data type

Short

Syntax

ObjectName.CurrentImageIndexInBuffer

Parameters

None.

Remarks

The index is 0 based.

By changing CurrentImageIndexInBuffer, you can enumerate all the images in buffer.

When CurrentImageIndexInBuffer is changed, the control will be redrawn to reflect the change.

When an image is added to buffer, the CurrentImageIndexInBuffer is skipped to the next one and the new image is added there.

When image buffer is full, that is HowManyImagesInBuffer = MaxImagesInBuffer, the new acquired or opened image will replace the existing one, positioned by CurrentImageIndexInBuffer.

For example, if HowManyImagesInBuffer = 4 and MaxImagesInBuffer = 4, CurrentImageIndexInBuffer = 3, after a new image is acquired, the CurrentImageIndexInBuffer is set to 0, and the 1st image is replaced by the new acquired one . If another image is acquired again, the CurrentImageIndexInBuffer is set to 1 and the 2nd image is replaced by the new acquired one.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

HowManyImagesInBuffer property, MaxImagesInBuffer property, RemoveImage() method

Sample

The following sample shows how to move the current image index to the next one.

VB Sample:
Private Sub MoveToNextImage()

    If Twain.CurrentImageIndexInBuffer = Twain.HowManyImagesInBuffer -1 Then  'Last image in buffer
        Twain.CurrentImageIndexInBuffer = 0
    Else
        Twain.CurrentImageIndexInBuffer = Twain.CurrentImageIndexInBuffer + 1
    End If

End Sub


Property CurrentSourceName

CurrentSourceName Property

Description

Returns the device name of current source. This is a runtime, read-only property.

Data type

String.

Syntax

ObjectName. CurrentSourceName

Remarks

If no source is currently selected, CurrentSourceName property returns "".

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

DefaultSourceName property.


Property DataSourceStatus

DataSourceStatus Property

Description

Returns the value indicating the data source status. This is a runtime, read-only property.

Data type

long

Syntax

ObjectName. DataSourceStatus

Remarks

Allowed values are between 0 and 3.

  • 0, indicate the data source is closed.
  • 1, indicate the data source is opened.
  • 2, indicate the data source is enabled.
  • 3, indicate the data source is acquiring image.


Property DefaultSourceName

DefaultSourceName Property

Description

Returns the device name of default source. This is a runtime, read-only property.

Data type

String.

Syntax

ObjectName. DefaultSourceName

Remarks

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

CurrentSourceName property.


Property Duplex

Duplex Property

Description

Returns whether the source supports duplex. If so, it further returns the level of duplex the Source supports (one pass or two pass duplex). This is a runtime, read-only property.

Data type

long

Syntax

ObjectName. Duplex

Remarks

Allowed Value | Duplex
0 | duplex is not supported
1 | 1-pass duplex
2 | 2-pass duplex

Using this property after calling OpenSource() method and before calling AcquireImage().

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

IfDuplexEnabled property

Samples

Do a duplex scan.


Property ErrorCode

ErrorCode Property

Description

Returns the error code. This is a runtime, read-only property.

Data type

Enumerated Value/Integer

Syntax

ObjectName. ErrorCode

Remarks

If no error occurs, TWERR_SUCCESS(0) is returned.

See also

ErrorString property


Property ErrorString

ErrorString Property

Description

Returns the error string. This is a runtime, read-only property.

Data type

String.

Syntax

ObjectName. ErrorString

Remarks

None.

See also

ErrorCode property


Property FTPPassword

FTPPassword

Description

Sets or returns the password used to log into the FTP server.

Data type

String.

Syntax

ObjectName. FTPPassword

Remarks

If you wish to use "anonymous" user name to log into a FTP server, just use the default value of FTPUserName property and FTPPassword property.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

FTPUserName property, FTPPort property, ProxyServer property, FTPDownload, FTPUpload(), HTTPPort property, HTTPUserName property, HTTPPassword property, HTTPDownload(), HTTPUploadThroughPut(), HTTPUploadThroughPost()


Property FTPPort

FTPPort

Description

Sets or returns the port number of the FTP server.

Data type

Integer

Syntax

ObjectName. FTPPort

Remarks

The default FTP port number is 21.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

FTPUserName property, FTPPassword property, ProxyServer property, FTPDownload, FTPUpload(), HTTPPort property, HTTPUserName property, HTTPPassword property, HTTPDownload(), HTTPUploadThroughPut(), HTTPUploadThroughPost()


Property FTPUserName

FTPUserName

Description

Sets or returns the user name used to log into the FTP server.

Data type

String.

Syntax

ObjectName. FTPUserName

Remarks

If you wish to use "anonymous" user name to log into a FTP server, just use the default value of FTPUserName property and FTPPassword property.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

FTPPassword property, FTPPort property, ProxyServer property, FTPDownload, FTPUpload(), HTTPPort property, HTTPUserName property, HTTPPassword property, HTTPDownload(), HTTPUploadThroughPut(), HTTPUploadThroughPost()


Property hDIB

hDIB Property

Description

Returns the Handle of the DIB (Device Independent Bitmap) of a specified index in buffer.

Data type

long

Syntax

ObjectName. hDIB(Short sImageIndex)

Parameters

Short sImageIndex: specifies the index of image in buffer. The index is 0-based.

Remarks

For Win32 programmer, the actual data type of hDIB is HANDLE.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.


Property HowManyImagesInBuffer

HowManyImagesInBuffer Property

Description

Returns how many images are in buffer. This is a runtime, read-only property.

Data type

Short

Syntax

ObjectName.HowManyImagesInBuffer

Parameters

None.

Remarks

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

MaxImagesInBuffer property, CurrentImageIndexInBuffer property, RemoveImage() method

Samples

Go through all the images in buffer with clicking "NextImage" or "PreImage" buttons.


Property HTTPPassword

HTTPPassword

Description

Sets or returns the password used to log into the HTTP server.

Data type

String.

Syntax

ObjectName. HTTPPassword

Remarks

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

FTPUserName property, FTPPassword property, FTPPort property, ProxyServer property, FTPDownload, FTPUpload(), HTTPPort property, HTTPUserName property, HTTPDownload(), HTTPUploadThroughPut(), HTTPUploadThroughPost()


Property HTTPPort

HTTPPort

Description

Sets or returns the port number of the HTTP server.

Data type

Integer

Syntax

ObjectName. HTTPPort

Remarks

The default HTTP port number is 80. This property is used with IfSSL property.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

IfSSL property, FTPUserName property, FTPPassword property, FTPPort property, ProxyServer property, FTPDownload, FTPUpload(), HTTPPassword property, HTTPUserName property, HTTPDownload(), HTTPUploadThroughPut(), HTTPUploadThroughPost()

Samples

JavaScript Sample:
<SCRIPT LANGUAGE="javascript">

function btnUpload_onclick()
{
frmScan.DynamicWebTwain1.HTTPPort = 80;
frmScan.DynamicWebTwain1.IfSSL = false; // If 80 is the port number of non-secure port

/*
frmScan.DynamicWebTwain1.HTTPPort = 443;
frmScan.DynamicWebTwain1.IfSSL = true; // If 443 is the port number of secure port
*/

...
}
</SCRIPT>


Property HTTPPostResponseString

HTTPPostResponseString

Description

Returns the response string from the HTTP server if an error occurs for HTTPUploadThroughPost() method. This is a runtime, read-only property.

Data type

String.

Syntax

ObjectName. HTTPPostResponseString

Remarks

If HTTPUploadThroughPost() method returns FALSE, check this property for response string from the HTTP server. If HTTPUploadThroughPost() method return TRUE, this property returns "".

See also

HTTPUploadThroughPost()


Property HTTPUserName

HTTPUserName

Description

Sets or returns the user name used to log into the HTTP server.

Data type

String.

Syntax

ObjectName. HTTPUserName

Remarks

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

FTPUserName property, FTPPassword property, FTPPort property, ProxyServer property, FTPDownload, FTPUpload(), HTTPPassword property, HTTPPort property, HTTPDownload(), HTTPUploadThroughPut(), HTTPUploadThroughPost()


Property IfAutoBright

IfAutoBright Property

Description

Returns or sets whether the Source's Auto-brightness function is enabled. This is a runtime property.

Data type

Boolean

Syntax

ObjectName. IfAutoBright

Remarks

Using this property after calling OpenSource() method and before calling AcquireImage().

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

Brightness property


Property IfAutoFeed

IfAutoFeed Property

Description

Returns or sets whether the Source enable automatic document feeding process. This is a runtime property.

Data type

Boolean

Syntax

ObjectName. IfAutoFeed

Remarks

If the value of this property is TRUE, the Source will automatically feed the next page from the document feeder after the previous page is acquired.

Using this property after opening the Data Source (see OpenSource() method) and checking if the value of IfFeederEnabled property is TRUE.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

IfFeederEnabled property, IfFeederLoaded property, IfPaperDetectable property, XferCount property

Samples

Scan with Automatic Document Feeder.


Property IfAutoScan

IfAutoScan Property

Description

Returns or sets whether the Source enables the automatic document scanning process. This is a runtime property.

Data type

Boolean

Syntax

ObjectName. IfAutoScan

Remarks

Using this property after opening the Data Source (see OpenSource() method) and checking if the value of IfFeederEnabled property is TRUE.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

IfAutoBright property, IfAutoFeed property


Property IfDeviceOnline

IfDeviceOnline Property

Description

Returns whether the Source is attached, powered on, and communicating. This is a runtime, read-only property.

Data type

Boolean

Syntax

ObjectName. IfDeviceOnline

Remarks

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.


Property IfDisableSourceAfterAcquire

IfDisableSourceAfterAcquire Property

Description

Returns or sets whether close the Data Source User Interface after acquire all images. Default value of this property is FALSE.

Data type

Boolean

Syntax

ObjectName. IfDisableSourceAfterAcquire

Remarks

IfShowUI | IfDisableSourceAfterAcquire | Actions
TRUE | FALSE | UI will be shown, user can acquire many images, user must close UI himself
TRUE | TRUE | UI will be shown, only one image will be acquired, UI will be closed automatically
FALSE | FALSE | UI will not be shown, one or many images will be acquired (if the source supports), the device will not be closed automatically and needs to be closed by DisableSource() method
FALSE | TRUE | UI will not be shown, one or many images will be acquired (if the source supports), the device will be closed automatically

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

EnableSource(), DisableSource(), IfShowUI property


Property IfDuplexEnabled

IfDuplexEnabled Property

Description

Returns or sets whether the Source supports duplex. If TRUE, the scanner scans both sides of a paper; otherwise, the scanner will scan only one side of the image. This is a runtime property.

Data type

Boolean

Syntax

ObjectName. IfDuplexEnabled

Remarks

Call OpenSource() method and confirm that the duplex is supported (see Duplex property) before using this property.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

Duplex property

Samples

Do a duplex scan.


Property IfFeederEnabled

IfFeederEnabled Property

Description

Returns or sets whether the Automatic Document Feeder (ADF) is enabled. This is a runtime property.

Data type

Boolean

Syntax

ObjectName. IfFeederEnabled

Remarks

If the value of this property is TRUE, Source must acquire data from the document feeder acquire area and other feeder capabilities can be used. If the value of this property is FALSE, Source must acquire data from the non-feeder acquire area and no other feeder capabilities can be used.

Call OpenSource() method before using this property.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

IfFeederLoaded property, IfPaperDetectable property, XferCount property, IfAutoFeed property

Samples

Scan with Automatic Document Feeder.


Property IfFeederLoaded

IfFeederLoaded Property

Description

Returns whether or not there are documents loaded in the Source's feeder when IfFeederEnabled and IfPaperDetectable are TRUE. This is a runtime, read-only property.

Data type

Boolean

Syntax

ObjectName. IfFeederLoaded

Remarks

Call OpenSource() method before using this property.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

IfFeederEnabled property, IfPaperDetectable property, XferCount property, IfAutoFeed property

Samples

Scan with Automatic Document Feeder.


Property IfFitWindow

IfFitWindow Property

Description

Sets or returns whether to resize the image to fit the size of window.

Data type

Boolean

Syntax

ObjectName. IfFitWindow

Remarks

The default value of the IfFitWindow property is True.


Property IfModalUI

IfModalUI Property

Description

Returns or sets whether the UI (User Interface) of Source runs in modal state. Default value of this property is TRUE.

Data type

Boolean

Syntax

ObjectName. IfModalUI

Remarks

If the property is TRUE, the TWAIN Data Source will display its User Interface as modal window when invoking the AcquireImage method.

See also

IfShowUI property, IfUIControllable property, IfDisableSourceAfterAcquire property


Property IfPaperDetectable

IfPaperDetectable Property

Description

Returns the value whether the Source has a paper sensor that can detect documents on the ADF or Flatbed. This is a runtime, read-only property.

Data type

Boolean

Syntax

ObjectName. IfPaperDetectable

Remarks

Reading this property after calling OpenSource() method.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

IfFeederEnabled property, IfFeederLoaded property, IfAutoFeed property, XferCount property


Property IfShowCancelDialogWhenImageTransfer

IfShowCancelDialogWhenImageTransfer Property

Description

Sets or returns whether to show the cancel dialog when uploading images to server.

Data type

Boolean

Syntax

ObjectName. IfShowCancelDialogWhenImageTransfer

Remarks

The default value of the IfShowCancelDialogWhenImageTransfer property is True.


Property IfShowIndicator

IfShowIndicator Property

Description

Returns or sets whether the Source displays a progress indicator during acquisition and transfer, regardless of whether the Source's user interface is active. This is a runtime property.

Data type

Boolean

Syntax

ObjectName. IfShowIndicator

Remarks

Using this property after calling OpenSource() method and before calling AcquireImage().

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

IfShowUI property


Property IfShowUI

IfShowUI Property

Description

Returns or sets whether the Source displays the User Interface.

Data type

Boolean

Syntax

ObjectName. IfShowUI

Remarks

If the property is TRUE, the TWAIN Data Source will display its User Interface when invoking the AcquireImage method. If the property is FALSE, the Data Source UI will not be displayed and scanning will begin immediately using the current capability values.

See also

IfModalUI property, IfUIControllable property, EnableSource().


Property IfThrowException

IfThrowException Property

Description

Returns or sets whether an exception will be thrown when an error occurs.

Data type

Boolean

Syntax

ObjectName. IfThrowException

Remarks

None.

See also

ErrorCode property, ErrorString property


Property IfTiffMultiPage

IfTiffMultiPage Property

Description

Return or sets whether the Source allows to save many images in one TIFF file. The default value is FALSE.

Data type

Boolean

Syntax

ObjectName. IfTiffMultiPage

Remarks

If this property is TRUE, the new image will be added to existing TIFF file.

Samples

Save each document in a separate TIFF 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

    Twain.IfFeederEnabled = True
    Twain.XferCount = -1
    Twain.IfAutoFeed = True 'Auto feed

    Twain.AcquireImage
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

Save acquired images as a Multi-Page TIFF file.


Property IfUIControllable

IfUIControllable Property

Description

Returns whether the Source supports acquisition with the UI (User Interface) disabled. If FALSE, indicates that this Source can only support acquisition with the UI enabled. This is a runtime, read-only property.

Data type

Boolean

Syntax

ObjectName. IfUIControllable

Remarks

Using this property after calling OpenSource() method.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

IfShowUI property, IfModalUI property


Property ImageBitsPerPixel

ImageBitsPerPixel Property

Description

The number of bits in each image pixel (or bit depth). This is a runtime, read-only property.

Data type

Integer

Syntax

ObjectName. ImageBitsPerPixel

Remarks

24-bit R-G-B has BitsPerPixel = 24. 8-bit Grayscale has BitsPerPixel = 8. Black and White has BitsPerPixel = 1.

ImageBitsPerPixel property, along with other properties about the current image information, is valid only in OnPreTransfer and OnPostTransfer event.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

ImagePixelType property, ImageLength property, ImageWidth property, ImageXResolution property, ImageYResolution property


Property ImageEditorIfEnableEnumerator

ImageEditorIfEnableEnumerator Property

Description

Returns or sets whether the image enumerator is enabled in Image Editor .

Data type

Boolean

Syntax

ObjectName. ImageEditorIfEnableEnumerator

Remarks

The default value is True.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

ImageEditorWindowTitle property,
ImageEditorIfReadonly property,
RotateLeft(),
RotateRight(),
Flip(), Mirror(),
Crop(),
CropToClipboard(), GetImageSize(),
ChangeImageSize(),
ShowImageEditor()


Property ImageEditorIfReadonly

ImageEditorIfReadonly Property

Description

Returns or sets whether the Image Editor is read-only.

Data type

Boolean

Syntax

ObjectName. ImageEditorIfReadonly

Remarks

The default value is False. If this property is True, the Image Editor GUI can only be viewed with all functionalities disabled.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

ImageEditorWindowTitle property,
ImageEditorIfEnableEnumerator
property, RotateLeft(),
RotateRight(),
Flip(), Mirror(),
Crop(),
CropToClipboard(), GetImageSize(),
ChangeImageSize(),
ShowImageEditor()


Property ImageEditorWindowTitle

ImageEditorWindowTitle Property

Description

Returns or sets the title of Image Editor window.

Data type

String

Syntax

ObjectName. ImageEditorWindowTitle

Remarks

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

ImageEditorIfReadonly property,
ImageEditorIfEnableEnumerator
property, RotateLeft(),
RotateRight(),
Flip(), Mirror(),
Crop(),
CropToClipboard(), GetImageSize(),
ChangeImageSize(),
ShowImageEditor()


Property ImageLayoutDocumentNumber

ImageLayoutDocumentNumber Property

Description

Returns the document number of the current image. This is a runtime, read-only property.

Data type

Long

Syntax

ObjectName. ImageLayoutDocumentNumber

Remarks

Usually, increment when a group of new pages is placed into the document feeder (usually tell this has happened when the feeder empties).

ImageLayoutDocumentNumber property, along with other properties about the current image information, is valid only in OnPreTransfer and OnPostTransfer event.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

ImageLayoutFrameLeft property, ImageLayoutFrameTop property, ImageLayoutFrameRight property, ImageLayoutFrameBottom property, ImageLayoutPageNumber property, ImageLayoutFrameNumber property


Property ImageLayoutFrameBottom

ImageLayoutFrameBottom Property

Description

Returns the value of the bottom-most edge of the current image frame (in ICAP_UNITS). This is a read-only runtime property.

Data type

Single (float)

Syntax

ObjectName. ImageLayoutFrameBottom

Remarks

The unit of ImageLayoutFrameBottom property is determined by ICAP_UNITS capability.

The default unit is assumed to be "inches" unless it has been otherwise negotiated between the application and source.

ImageLayoutFrameBottom property, along with other properties about the current image information, is valid only in OnPreTransfer and OnPostTransfer event.

The frame information here is only about the current frame. To get the information about all the frames to be transferred in an acquire session, please use capability negotiation. The capability to be negotiated is ICAP_FRAMES. Please refer to How to negotiate ICAP_FRAMES for details and sample code.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

ImageLayoutFrameLeft property, ImageLayoutFrameTop property, ImageLayoutFrameRight property, ImageLayoutDocumentNumber property, ImageLayoutPageNumber property, ImageLayoutFrameNumber property


Property ImageLayoutFrameLeft

ImageLayoutFrameLeft Property

Description

Returns the value of the left-most edge of the current image frame (in ICAP_UNITS). This is a runtime, read-only property.

Data type

Single (float)

Syntax

ObjectName. ImageLayoutFrameLeft

Remarks

The unit of ImageLayoutFrameLeft property is determined by ICAP_UNITS capability.

The default unit is assumed to be "inches" unless it has been otherwise negotiated between the application and source.

ImageLayoutFrameLeft property, along with other properties about the current image information, is valid only in OnPreTransfer and OnPostTransfer event.

The frame information here is only about the current frame. To get the information about all the frames to be transferred in an acquire session, please use capability negotiation. The capability to be negotiated is ICAP_FRAMES. Please refer to How to negotiate ICAP_FRAMES for details and sample code.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

ImageLayoutFrameTop property, ImageLayoutFrameRight property, ImageLayoutFrameBottom property, ImageLayoutDocumentNumber property, ImageLayoutPageNumber property, ImageLayoutFrameNumber property


Property ImageLayoutFrameNumber

ImageLayoutFrameNumber Property

Description

Returns the frame number of the current image. This is a runtime, read-only property.

Data type

Long

Syntax

ObjectName. ImageLayoutFrameNumber

Remarks

The frames are acquired from the same page. The number is reset when a new page is acquired.

ImageLayoutFrameNumber property, along with other properties about the current image information, is valid only in OnPreTransfer and OnPostTransfer event.

The frame information here is only about the current frame. To get the information about all the frames to be transferred in an acquire session, please use capability negotiation. The capability to be negotiated is ICAP_FRAMES. Please refer to How To Negotiate ICAP_FRAMES for details and sample code.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

ImageLayoutFrameLeft property, ImageLayoutFrameTop property, ImageLayoutFrameRight property, ImageLayoutFrameBottom property, ImageLayoutDocumentNumber property, ImageLayoutPageNumber property


Property ImageLayoutFrameRight

ImageLayoutFrameRight Property

Description

Returns the value of the right-most edge of the current image frame (in ICAP_UNITS). This is a runtime, read-only property.

Data type

Single (float)

Syntax

ObjectName. ImageLayoutFrameRight

Remarks

The unit of ImageLayoutFrameRight property is determined by ICAP_UNITS capability.

The default unit is assumed to be "inches" unless it has been otherwise negotiated between the application and source.

ImageLayoutFrameRight property, along with other properties about the current image information, is valid only in OnPreTransfer and OnPostTransfer event.

The frame information here is only about the current frame. To get the information about all the frames to be transferred in an acquire session, please use capability negotiation. The capability to be negotiated is ICAP_FRAMES. Please refer to How to negotiate ICAP_FRAMES for details and sample code.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

ImageLayoutFrameLeft property, ImageLayoutFrameTop property, ImageLayoutFrameBottom property, ImageLayoutDocumentNumber property, ImageLayoutPageNumber property, ImageLayoutFrameNumber property


Property ImageLayoutFrameTop

ImageLayoutFrameTop Property

Description

Returns the value of the top-most edge of the current image frame (in ICAP_UNITS). This is a runtime, read-only property.

Data type

Single (float)

Syntax

ObjectName. ImageLayoutFrameTop

Remarks

The unit of ImageLayoutFrameTop property is determined by ICAP_UNITS capability.

The default unit is assumed to be "inches" unless it has been otherwise negotiated between the application and source.

ImageLayoutFrameTop property, along with other properties about the current image information, is valid only in OnPreTransfer and OnPostTransfer event.

The frame information here is only about the current frame. To get the information about all the frames to be transferred in an acquire session, please use capability negotiation. The capability to be negotiated is ICAP_FRAMES. Please refer to How to negotiate ICAP_FRAMES for details and sample code.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

ImageLayoutFrameLeft property, ImageLayoutFrameRight property, ImageLayoutFrameBottom property, ImageLayoutDocumentNumber property, ImageLayoutPageNumber property, ImageLayoutFrameNumber property


Property ImageLayoutPageNumber

ImageLayoutPageNumber Property

Description

Returns the page number of the current image. This is a runtime, read-only property.

Data type

Long

Syntax

ObjectName. ImageLayoutPageNumber

Remarks

Increment for each page fed from a page feeder.

ImageLayoutPageNumber property, along with other properties about the current image information, is valid only in OnPreTransfer and OnPostTransfer event.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

ImageLayoutFrameLeft property, ImageLayoutFrameTop property, ImageLayoutFrameRight property, ImageLayoutFrameBottom property, ImageLayoutDocumentNumber property, ImageLayoutFrameNumber property


Property ImageLength

ImageLength Property

Description

Returns how tall/long, in pixels, the image is. This is a runtime, read-only property.

Data type

Long

Syntax

ObjectName. ImageLength

Remarks

-1 is returned, if the Source doesn't know the length of the image.(hand scanners may do this).

ImageLength property, along with other properties about the current image information, is valid only in OnPreTransfer and OnPostTransfer event.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

ImageBitsPerPixel property, ImagePixelType property, ImageWidth property, ImageXResolution property, ImageYResolution property


Property ImageMargin

ImageMargin Property

Description

Returns or sets the margin between images when multiple images are displayed in Dynamic Web TWAIN.

Data type

Short

Syntax

ObjectName. ImageMargin

Remarks

The default value will auto judge.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

SetViewMode(), GetViewMode(), MouseShape property


Property ImagePixelType

ImagePixelType Property

Description

Returns the pixel type of the current image. This is a runtime, read-only property.

Data type

Enumerated Value / Integer

Value | Description
TWPT_BW(0) | Black and White
TWPT_GRAY(1) | Grayscaled
TWPT_RGB(2 ) | RGB

Syntax

ObjectName. ImagePixelType

Remarks

ImagePixelType property, along with other properties about the current image information, is valid only in OnPreTransfer and OnPostTransfer event.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

ImageBitsPerPixel property, ImageLength property, ImageWidth property, ImageXResolution property, ImageYResolution property


Property ImageWidth

ImageWidth Property

Description

Returns how width, in pixels, the image is. This is a runtime, read-only property.

Data type

Long

Syntax

ObjectName. ImageWidth

Remarks

-1 is returned, if the Source doesn't know the width of the image. (handhold scanners may do this).

ImageWidth property, along with other properties about the current image information, is valid only in OnPreTransfer and OnPostTransfer event.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

ImageBitsPerPixel property, ImagePixelType property, ImageLength property, ImageXResolution property, ImageYResolution property


Property ImageXResolution

ImageXResolution Property

Description

Returns the X resolution of the current image. X resolution is the number of pixels per ICAP_UNITS in the horizontal direction. This is a runtime, read-only property.

Data type

Single (float)

Syntax

ObjectName. ImageXResolution

Remarks

The unit of ImageXResolution property is determined by ICAP_UNITS capability.

The default unit is assumed to be "inches" unless it has been otherwise negotiated between the application and source.

ImageXResolution property, along with other properties about the current image information, is valid only in OnPreTransfer and OnPostTransfer event.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

ImageBitsPerPixel property, ImageLength property, ImagePixelType property, ImageWidth property, ImageYResolution property


Property ImageYResolution

ImageYResolution Property

Description

Returns the Y resolution of the current image. Y resolution is the number of pixels per ICAP_UNITS in the vertical direction. This is a runtime, read-only property.

Data type

Single (float)

Syntax

ObjectName. ImageYResolution

Remarks

The unit of ImageYResolution property is determined by ICAP_UNITS capability.

The default unit is assumed to be "inches" unless it has been otherwise negotiated between the application and source.

ImageYResolution property, along with other properties about the current image information, is valid only in OnPreTransfer and OnPostTransfer event.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

ImageBitsPerPixel property, ImageLength property, ImagePixelType property, ImageWidth property, ImageXResolution property


Property JPEGQuality

JPEGQuality

Description

Returns or sets the quality of the JPEG file.

Data type

Integer

Syntax

ObjectName. JPEGQuality

Remarks

The default value of JPEGQuality property is 80.

The valid range is 0-100. The higher the JPEGQuality property, the better the JPEG quality and the greater the size of the file.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

SaveAsJPEG(), FTPUpload()


Property Manufacturer

Manufacturer Property

Description

Sets or returns the manufacture string for the application identity.

Data type

String. The max length is 32.

Syntax

ObjectName. Manufacturer

Remarks

The Manufacturer property is a part of the application identity. The application identity consists of the Manufacturer, ProductFamily, ProductName and VersionInfo properties. These information may be shown in Source's interface.

All the application identity information should be set prior to invoking OpenSourceManager(). Since with built-in Wizard Mode, Dynamic TWAIN manages the transition of TWAIN state intelligently, OpensourceManager() may be called automatically by other TWAIN related functions, such as OpenSource() or AcquireImage(). It is recommended that application identity information should be set prior to any other TWAIN functions.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

OpenSourceManager(), ProductFamily property, ProductName property, VersionInfo property, TWAIN state transition


Property MaxImagesInBuffer

MaxImagesInBuffer Property

Description

Returns or sets the maximum number of images can be held in buffer.

Data type

Short

Syntax

ObjectName.MaxImagesInBuffer

Parameters

None.

Remarks

The default value of this property is 1.

If you set a MaxImagesInBuffer which is smaller than HowManyImagesInBuffer, the extra images in buffer will be released.

When image buffer is full, that is HowManyImagesInBuffer = MaxImagesInBuffer, the new acquired or opened image will replace the existing one, positioned by CurrentImageIndexInBuffer.

For example, if HowManyImagesInBuffer = 4 and MaxImagesInBuffer = 4, CurrentImageIndexInBuffer = 3, after a new image is acquired, the CurrentImageIndexInBuffer is set to 0, and the 1st image is replaced by the new acquired one . If another image is acquired again, the CurrentImageIndexInBuffer is set to 1 and the 2nd image is replaced by the new acquired one.

Note: CurrentImageIndexInBuffer is 0 based.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

HowManyImagesInBuffer property, CurrentImageIndexInBuffer property


Property MouseShape

MouseShape Property

Description

Returns or sets the shape of the mouse.

Data type

Boolean

Syntax

ObjectName. MouseShape

Remarks

When the value of the property is set to TRUE, the cursor is set as a hand. When the value of the property is set to FALSE, the cursor is set as an arrow.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

SetViewMode(), GetViewMode(), ImageMargin property


Property PageSize

PageSize Property

Description

Returns or sets the page size(s) the Source can/should use to acquire image data. This is a runtime property.

Data type

short

Syntax

ObjectName. PageSize

Remarks

Allowed Values | Page size
0 | None
1 | A4LETTER, A4
2 | B5LETTER, JISB5
3 | USLETTER
4 | USLEGAL
5 | A5
6 | B4, ISOB4
7 | B6, ISOB6
9 | USLEDGER
10 | USEXECUTIVE
11 | A3
12 | B3, ISOB3
13 | A6
14 | C4
15 | C5
16 | C6
17 | 4A0
18 | 2A0
19 | A0
20 | A1
21 | A2
22 | A7
23 | A8
24 | A9
25 | A10
26 | ISOB0
27 | ISOB1
28 | ISOB2
29 | ISOB5
30 | ISOB7
31 | ISOB8
32 | ISOB9
33 | ISOB10
34 | JISB0
35 | JISB1
36 | JISB2
37 | JISB3
38 | JISB4
39 | JISB6
40 | JISB7
41 | JISB8
42 | JISB9
43 | JISB10
44 | C0
45 | C1
46 | C2
47 | C3
48 | C7
49 | C8
50 | C9
51 | C10
52 | USEXECUTIVE
53 | BUSINESSCARD

Using this property after calling OpenSource() method and before calling AcquireImage().

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

OpenSource()


Property PDFAuthor

PDFAuthor Property

Description

Sets or returns the name of the person who creates the PDF document.

Data type

String. The max length is 255.

Syntax

ObjectName. PDFAuthor

Remarks

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

PDFTitle property, PDFSubject property, PDFKeywords property, PDFCreationDate property, PDFModifiedDate property, PDFCreator property, PDFProducer property


Property PDFCompressionType

PDFCompressionType Property

Description

Returns or sets the compression type of PDF files. This is a runtime property.

Data type

Integer

Syntax

ObjectName. PDFCompressionType

Parameters

None.

Remarks

Allowed Values | PDF compression type | Description | Supported image format
0 | PDF_AUTO | Auto mode | 1, 4, 8, 24 bit
1 | PDF_FAX3 | CCITT Group 3 fax encoding | 1 bit
2 | PDF_FAX4 | CCITT Group 4 fax encoding | 1 bit
3 | PDF_LZW | Lempel-Ziv & Welch | 1, 4, 8, 24 bit
4 | PDF_RLE | CCITT modified Huffman RLE | 1 bit
5 | PDF_JPEG | JPEG encoding | 4, 8, 24 bit

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

SaveAsPDF() method, SaveAllAsPDF() method


Property PDFCreationDate

PDFCreationDate Property

Description

Sets or returns the date when the PDF document is created.

Data type

String. The max length is 255.

Syntax

ObjectName. PDFCreationDate

Remarks

The default value is current date.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

PDFTitle property, PDFAuthor property, PDFSubject property, PDFKeywords property, PDFModifiedDate property, PDFCreator property, PDFProducer property


Property PDFCreator

PDFCreator Property

Description

Sets or returns the name of the application that created the original document, if the PDF document is converted from another form.

Data type

String. The max length is 255.

Syntax

ObjectName. PDFCreator

Remarks

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

PDFTitle property, PDFAuthor property, PDFSubject property, PDFKeywords property, PDFCreationDate property, PDFModifiedDate property, PDFProducer property


Property PDFKeywords

PDFKeywords Property

Description

Sets or returns the keywords associated with the PDF document.

Data type

String. The max length is 255.

Syntax

ObjectName. PDFKeywords

Remarks

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

PDFTitle property, PDFAuthor property, PDFSubject property, PDFCreationDate property, PDFModifiedDate property, PDFCreator property, PDFProducer property


Property PDFModifiedDate

PDFModifiedDate Property

Description

Sets or returns the date when the PDF document is last modified.

Data type

String. The max length is 255.

Syntax

ObjectName. PDFModifiedDate

Remarks

The default value is current date.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

PDFTitle property, PDFAuthor property, PDFSubject property, PDFKeywords property, PDFCreationDate property, PDFCreator property, PDFProducer property


Property PDFProducer

PDFProducer Property

Description

Sets or returns the name of the application that converted the PDF document from its native.

Data type

String. The max length is 255.

Syntax

ObjectName. PDFProducer

Remarks

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

PDFTitle property, PDFAuthor property, PDFSubject property, PDFKeywords property, PDFCreationDate property, PDFModifiedDate property, PDFCreator property


Property PDFSubject

PDFSubject Property

Description

Sets or returns the subject of the PDF document.

Data type

String. The max length is 255.

Syntax

ObjectName. PDFSubject

Remarks

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

PDFTitle property, PDFAuthor property, PDFKeywords property, PDFCreationDate property, PDFModifiedDate property, PDFCreator property, PDFProducer property


Property PDFTitle

PDFTitle Property

Description

Sets or returns the title of the PDF document.

Data type

String. The max length is 255.

Syntax

ObjectName. PDFTitle

Remarks

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

PDFAuthor property, PDFSubject property, PDFKeywords property, PDFCreationDate property, PDFModifiedDate property, PDFCreator property, PDFProducer property


Property PendingXfers

PendingXFERs Property

Description

Returns the number of transfers the Source is ready to supply, upon demand. This is a runtime, read-only property.

Data type

Long

Syntax

ObjectName. PendingXFERs

Remarks

This property is valid only in OnPostTransfer event.

The Data Source returns -1 if it is not sure how many transfers are pending. Scanners with ADF (Automatic Document Feeder) will typically return -1 if the current image is not the last one.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

OnPostTransfer event, CancelAllPendingTransfers method


Property Picture

Picture Property

Description

Returns the Picture object of the image of a specified index in buffer. This is a runtime, read-only property.

Data type

Picture

Syntax

ObjectName. Picture(Short sImageIndex)

Parameters

Short sImageIndex: specifies the index of the image in buffer. The index is 0-based.

Remarks

The Picture property implements the IPictureDisp interface.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

Sample

VB Sample:
Private Sub Twain_OnPostTransfer()
    Image1.Picture = Twain.Picture(0)
End Sub


Property PixelFlavor

PixelFlavor Property

Description

Returns or sets the pixel flavor for acquired images. This is a runtime property.

Data type

short

Syntax

ObjectName. PixelFlavor

Remarks

Allowed Values | Pixel flavor
0 | Chocolate. Zero pixel represents darkest shade.
1 | Vanilla. Zero pixel represents lightest shade.

Using this property after calling OpenSource() method and before calling AcquireImage().

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

PixelType property, OpenSource()


Property PixelType

PixelType Property

Description

Returns or sets the pixel type of acquired images. This is a runtime property.

Data type

short

Syntax

ObjectName. PixelType

Remarks

Allowed Values | PixelType
0 | BW
1 | GRAY
2 | RGB
3 | PALETTE
4 | CMY
5 | CMYK
6 | YUV
7 | YUVK
8 | CIEXYZ

Using this property after calling OpenSource() method and before calling AcquireImage().

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

PixelFlavor property, OpenSource()


Property ProductFamily

ProductFamily Property

Description

Sets or returns the product family string for the application identity.

Data type

String. The max length is 32.

Syntax

ObjectName. ProductFamily

Remarks

The ProductFamily property is a part of the application identity. The application identity consists of the Manufacturer, ProductFamily, ProductName and VersionInfo properties. These information may be shown in Source's interface.

All the application identity information should be set prior to invoking OpenSourceManager(). Since with built-in Wizard Mode, Dynamic TWAIN manages the transition of TWAIN state intelligently, OpensourceManager() may be called automatically by other TWAIN related functions, such as OpenSource() or AcquireImage(). It is recommended that application identity information should be set prior to any other TWAIN functions.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

OpenSourceManager(), Manufacturer property, ProductName property, VersionInfo property, TWAIN state transition


Property ProductName

ProductName Property

Description

Sets or returns the product name string for the application identity.

Data type

String. The max length is 32.

Syntax

ObjectName. ProductName

Remarks

The ProductName property is a part of the application identity. The application identity consists of the Manufacturer, ProductFamily, ProductName and VersionInfo properties. These information may be shown in Source's interface.

All the application identity information should be set prior to invoking OpenSourceManager(). Since with built-in Wizard Mode, Dynamic TWAIN manages the transition of TWAIN state intelligently, OpensourceManager() may be called automatically by other TWAIN related functions, such as OpenSource() or AcquireImage(). It is recommended that application identity information should be set prior to any other TWAIN functions.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

OpenSourceManager(), Manufacturer property, ProductFamily property, VersionInfo property, TWAIN state transition


Property ProxyServer

ProxyServer

Description

Sets or returns the name of the proxy server.

Data type

String

Syntax

ObjectName. ProxyServer

Remarks

The value of this property should be set like "protocol=protocol://proxyServerIP(or name):proxyport". For example, if the proxy follows the HTTP protocol, the code should be:
WebTwain.ProxyServer = "http=http://192.168.1.100:8080";

Also, when the value of the ProxyServer property is not set, Dynamic Web TWAIN will get the proxy settings from IE.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

FTPUserName property, FTPPassword property, FTPPort property, ProxyServer property, FTPDownload, FTPUpload(), HTTPUserName property, HTTPPassword property, HTTPPort property, HTTPDownload(), HTTPUploadThroughPut(), HTTPUploadThroughPost()


Property Resolution

Resolution Property

Description

Returns or sets the current resolution for acquired images. This is a runtime property.

Data type

float

Syntax

ObjectName. Resolution

Remarks

Using this property after calling OpenSource() method and before calling AcquireImage().

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

OpenSource()


Property SourceCount

SourceCount Property

Description

Returns how many sources are installed in the system. This is a runtime, read-only property.

Data type

Integer

Syntax

ObjectName. SourceCount

Remarks

If SourceCount is 0, no source is installed or the Source Manager is not open.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

OpenSourceManager(),
SelectSource(),
SelectSourceByIndex(),
SourceNameItems
property

Samples

Select necessary device without device selection dialog.


Property SourceNameItems

SourceNameItems Property

Description

Holds an array of source names. This is a runtime, read-only property.

Data type

String.

Syntax

ObjectName. SourceNameItems(Integer index)

Remarks

This property has a parameter.

The index is 0-based and can not be greater than SourceCount property.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

SelectSourceByIndex(), SourceCount property

Samples

Select necessary device without device selection dialog.


Property TransferMode

TransferMode Property

Description

Sets or returns the transfer mode.

Data type

Enumerated value/Integer

Value | Description
TWSX_NATIVE (0) | NATIVE mode is the default mode. In this mode, the whole image is transfered in a single memory block.
TWSX_FILE (1) | DISK FILE mode is not required by TWAIN specification. In this mode, the image is transfered to a specified file directly. The disk file mode is ideal when transferring large images that might encounter memory limitations with Native mode.
TWSX_MEMORY (2) | MEMORY mode is also required by TWAIN, like NATIVE mode. Although this mode is the most complex, Dynamic TWAIN handles the tranfer details, making it as simple as NATIVE mode.

Syntax

ObjectName.TransferMode

Remarks

The default value of the TransferMode property is TWSX_NATIVE (0).

For DISK FILE mode, since it is not required by TWAIN, the application needs to make sure it is supported by the current Source. One way to do this is checking the TransferMode property after OpenSource() to see if it is still TWSX_FILE. The following is a sample:

VB Sample:
    Twain.OpenSource
    Twain.TransferMode = TWSX_FILE

    If (Twain.TransferMode = TWSX_FILE) Then

        If (Twain.SetFileXFERInfo("c:\Twain.bmp", TWFF_BMP) = True) Then
        Twain.IfShowUI = FALSE
            Twain.EnableSource
        End If

    End If

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

OpenSource(), SetFileXFERInfo()


Property TiffCompressionType

TIFFCompressionType Property

Description

Returns or sets the compression type of TIFF files. This is a runtime property.

Data type

Integer

Syntax

ObjectName. TIFFCompressionType

Parameters

None.

Remarks

Allowed Values | Tiff compression type | Description | Supported image format
0 | TIFF_AUTO | Auto mode | 1, 4, 8, 24 bit
1 | TIFF_NONE | Dump mode | 1, 4, 8, 24 bit
2 | TIFF_RLE | CCITT modified Huffman RLE | 1 bit
3 | TIFF_FAX3 | CCITT Group 3 fax encoding | 1 bit
3 | TIFF_T4 | CCITT T.4 (TIFF 6 name) | 1 bit
4 | TIFF_FAX4 | CCITT Group 4 fax encoding | 1 bit
4 | TIFF_T6 | CCITT T.6 (TIFF 6 name) | 1 bit
5 | TIFF_LZW | Lempel-Ziv & Welch | 1, 4, 8, 24 bit
32773 | TIFF_PACKBITS | Macintosh RLE | 1, 4, 8, 24 bit

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

SaveAsTIFF() method, SaveAllAsMultiPageTIFF() method


Property Unit

Unit Property

Description

Returns or sets the unit of measure. This is a runtime property.

Data type

short

Syntax

ObjectName. Unit

Remarks

Allowed Values | Unit
0 | INCHES
1 | CENTIMETERS
2 | PICAS
3 | POINTS
4 | TWIPS
5 | PIXELS

Using this property after calling OpenSource() method and before calling AcquireImage().

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.


Property VersionInfo

VersionInfo Property

Description

Sets or returns the version info string for the application identity.

Data type

String. The max length is 32.

Syntax

ObjectName. VersionInfo

Remarks

The VersionInfo property is a part of the application identity. The application identity consists of the Manufacturer, ProductFamily, ProductName and VersionInfo properties. These information may be shown in Source's interface.

All the application identity information should be set prior to invoking OpenSourceManager(). Since with built-in Wizard Mode, Dynamic TWAIN manages the transition of TWAIN state intelligently, OpensourceManager() may be called automatically by other TWAIN related functions, such as OpenSource() or AcquireImage(). It is recommended that application identity information should be set prior to any other TWAIN functions.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

OpenSourceManager(), Manufacturer property, ProductFamily property, ProductName property, TWAIN state transition


Property XferCount

XferCount Property

Description

Returns and sets the number of images you are willing to transfer per session. This is a runtime property.

Data type

short

Syntax

ObjectName. XferCount

Remarks

Allowed values are between -1 and 215

  • N, indicate willing to transfer N images this session.
  • -1, indicate willing to transfer multiple images.

Using this property after calling OpenSource() method.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

IfPaperDetectable property, IfFeederEnabled property, IfFeederLoaded property, IfAutoFeed property

Samples

Scan with Automatic Document Feeder.


Events

OnMouseClick Event

OnMouseMove Event

OnPreAllTransfers Event

OnPreTransfer Event

OnPostTransfer Event

OnPostAllTransfers Event

OnTransferCancelled Event

OnTransferError Event

OnInternetTransferPercentage Event


OnMouseClick Event

OnMouseClick

Description

Fired when mouse clicks an image.

Syntax

Object_OnMouseClick(Short sImageIndex)

Remarks

Short sImageIndex >=0. When the value of sImageIndex equals -1, it indicates that no image is clicked.

See Also

OnPreAllTransfers Event, OnPreTransfer Event, OnPostAllTransfers Event, OnTransferCancelled Event, OnTransferError Event, OnMouseMove Event.


OnMouseMove Event

OnMouseMove

Description

Fired when mouse move on an image.

Syntax

Object_OnMouseMove(Short sImageIndex)

Remarks

Short sImageIndex >=0. When the value of sImageIndex equals -1, it indicates that mouse is not on any image.

See Also

OnPreAllTransfers Event, OnPreTransfer Event, OnPostAllTransfers Event, OnTransferCancelled Event, OnTransferError Event, OnMouseClick Event.


OnPreAllTransfers Event

OnPreAllTransfers

Description

Fired before all the transfers begin.

Syntax

Object_OnPreAllTransfers()

Remarks

Multiple transfers may occur when ADF(Auto Document Feeder) is enabled or there are more than one frames in a page. In those cases, more than one OnPreTransfer Event will be fired, and only one OnPreAllTransfers Event will be fired.

This is the place to call CancelAllPendingTransfers().

See Also

OnPreTransfer Event, OnPostAllTransfers Event, OnPostTransfer Event, OnTransferCancelled Event, OnTransferError Event.


OnPreTransfer Event

OnPreTransfer

Description

Fired before a transfer begins.

Syntax

Object_OnPreTransfer()

Remarks

This is the place to read the properties of image information: ImageBitsPerPixel property, ImagePixelType property, ImageLength property, ImageWidth property, ImageXResolution property, ImageYResolution property, ImageLayoutDocumentNumber property, ImageLayoutFrameLeft property, ImageLayoutFrameTop property, ImageLayoutFrameRight property, ImageLayoutFrameBottom property, ImageLayoutPageNumber property, ImageLayoutFrameNumber property.

This is also the place to call CancelAllPendingTransfers().

See Also

OnPreAllTransfers Event, OnPostAllTransfers Event, OnPostTransfer Event, OnTransferCancelled Event, OnTransferError Event.


OnPostTransfer Event

OnPostTransfer

Description

Fired after a transfer ends.

Syntax

Object_OnPostTransfer()

Remarks

This is the place to check PendingXFERs property.

This is the place to read the properties of image information: ImageBitsPerPixel property, ImagePixelType property, ImageLength property, ImageWidth property, ImageXResolution property, ImageYResolution property, ImageLayoutDocumentNumber property, ImageLayoutFrameLeft property, ImageLayoutFrameTop property, ImageLayoutFrameRight property, ImageLayoutFrameBottom property, ImageLayoutPageNumber property, ImageLayoutFrameNumber property.

This is also the place to call CancelAllPendingTransfers().

See Also

OnPreAllTransfers Event, OnPreTransfer Event, OnPostAllTransfers Event, OnTransferCancelled Event, OnTransferError Event.


OnPostAllTransfers Event

OnPostAllTransfers

Description

Fired after all the transfers end.

Syntax

Object_OnPostAllTransfers()

Remarks

Multiple transfers may occur when ADF(Auto Document Feeder) is enabled or there are more than one frames in a page. In those cases, more than one OnPostTransfer Event will be fired, and only one OnPostAllTransfers Event will be fired.

See Also

OnPreAllTransfers Event, OnPreTransfer Event, OnPostTransfer Event, OnTransferCancelled Event, OnTransferError Event.


OnTransferCancelled Event

OnTransferCancelled

Description

Fired when the transfer is cancelled by the user.

Syntax

Object_OnTransferCancelled()

Remarks

This event is triggered only when the user cancels the transfer in the source's user interface. Calling CancelAllPendingTransfers() does not trigger the event.

See Also

OnPreAllTransfers Event, OnPreTransfer Event, OnPostAllTransfers Event, OnPostTransfer Event, OnTransferError Event.


OnTransferError Event

OnTransferError

Description

Fired when error occurs during the process of transfer.

Syntax

Object_OnTransferError()

See Also

OnPreAllTransfers Event, OnPreTransfer Event, On PostAllTransfers Event, OnPostTransfer Event, OnTransferCancelled Event.


OnInternetTransferPercentage Event

OnInternetTransferPercentage

Description

Fired when uploading or downloading images via HTTP or FTP.

Syntax

Object_OnInternetTransferPercentage(Short sPercent; BOOL * pbCancel)

Remarks

This event is triggered when user uploads or downloads images via HTTP or FTP.

See Also

OnPreAllTransfers Event, OnPreTransfer Event, OnPostAllTransfers Event, OnTransferCancelled Event, OnTransferError Event, OnMouseClick Event, OnMouseMove Event.


Categorical list of capabilities (functionality)

Capabilities in Categories of Functionality

Automatic Adjustments

ICAP_AUTOMATICBORDERDETECTION Turns automatic border detection on and off.
ICAP_AUTOMATICDESKEW Turns automatic skew correction on and off.
ICAP_AUTODISCARDBLANKPAGES Discards blank pages.
ICAP_AUTOMATICROTATE When TRUE, depends on source to automatically rotate the image.
ICAP_FLIPROTATION Orients images that flip orientation every other image.

Automatic Capture

CAP_AUTOMATICCAPTURE Specifies the number of images to automatically capture.
CAP_TIMEBEFOREFIRSTCAPTURE Selects the number of seconds before the first picture is taken.
CAP_TIMEBETWEENCAPTURES Selects the hundredths of a second to wait between pictures taken.

Automatic Scanning

CAP_AUTOSCAN Enables the source's automatic document scanning process.
CAP_CLEARBUFFERS MSG_GET reports presence of data in scanner's buffers; MSG_SET clears the buffers.
CAP_MAXBATCHBUFFERS Describes the number of pages that the scanner can buffer when CAP_AUTOSCAN is enabled.

Capability Negotiation Parameters

CAP_EXTENDEDCAPS Capabilities negotiated in States 5 & 6
CAP_SUPPORTEDCAPS Inquire Source's capabilities valid for MSG_GET

Color

ICAP_FILTER Color characteristics of the subtractive filter applied to the image data
ICAP_GAMMA Gamma correction value for the image data
ICAP_PLANARCHUNKY Color data format - Planar or Chunky

Device Parameters

CAP_DEVICEONLINE Determines if hardware is on and ready
CAP_DEVICETIMEDATE Date and time of a device's clock.
CAP_SERIALNUMBER The serial number of the currently selected source device.
ICAP_EXPOSURETIME Exposure time used to capture the image, in seconds
ICAP_FLASHUSED2 For devices that support a flash, MSG_SET selects the flash to be used; MSG_GET reports the current setting.
ICAP_IMAGEFILTER For devices that support image filtering, selects the algorithm to be used.
ICAP_LAMPSTATE Is the lamp on?
ICAP_LIGHTPATH Image was captured transmissively or reflectively
ICAP_LIGHTSOURCE Describes the color characteristic of the light source used to acquire the image
ICAP_NOISEFILTER For devices that support noise filtering, selects the algorithm to be used.
ICAP_OVERSCAN For devices that support overscanning, controls whether additional rows or columns are appended to the image.
ICAP_PHYSICALHEIGHT Maximum height Source can acquire (in ICAP_UNITS)
ICAP_PHYSICALWIDTH Maximum width Source can acquire (in ICAP_UNITS)
ICAP_UNITS Unit of measure (inches, centimeters, etc.)
ICAP_ZOOMFACTOR With MSG_GET, returns all camera supported lens zooming range.

Imprinter/Endorser Functionality

CAP_PRINTER MSG_GET returns current list of available printer devices; MSG_SET selects the device for negotiation.
CAP_PRINTERENABLED Turns the current CAP_PRINTER device on or off.
CAP_PRINTERINDEX Starting number for the CAP_PRINTER device.
CAP_PRINTERMODE Specifies appropriate current CAP_PRINTER device mode.
CAP_PRINTERSTRING String(s) to be used in the string component when
CAP_PRINTER device is enabled.
CAP_PRINTERSUFFIX String to be used as current CAP_PRINTER device's suffix.

Image Information

CAP_AUTHOR Author of acquired image (may include a copyright string)
CAP_CAPTION General note about acquired image
CAP_TIMEDATE Date and Time the image was acquired (entered State 7)

Image Parameters for Acquire

ICAP_AUTOBRIGHT Enable Source's Auto-brightness function
ICAP_BRIGHTNESS Source brightness values
ICAP_CONTRAST Source contrast values
ICAP_HIGHLIGHT Lightest highlight, values lighter than this value will be set to this value
ICAP_ORIENTATION Defines which edge of the paper is the top: Portrait or Landscape
ICAP_ROTATION Source can, or should, rotate image this number of degrees
ICAP_SHADOW Darkest shadow, values darker than this value will be set to this value
ICAP_XSCALING Source Scaling value (1.0 = 100%) for x-axis
ICAP_YSCALING Source Scaling value (1.0 = 100%) for y-axis

Image Type

ICAP_BITDEPTH Pixel bit depth for Current value of ICAP_PIXELTYPE
ICAP_BITDEPTHREDUCTION Allows a choice of the reduction method for bit depth loss
ICAP_BITORDER Specifies how the bytes in an image are filled by the Source
ICAP_CUSTHALFTONE Square-cell halftone (dithering) matrix to be used
ICAP_HALFTONES Source halftone patterns
ICAP_PIXELFLAVOR Sense of the pixel whose numeric value is zero
ICAP_PIXELTYPE The type of pixel data (B/W, gray, color, etc.)
ICAP_THRESHOLD Specifies the dividing line between black and white values

Language Support

CAP_LANGUAGE Allows application and source to identify which languages they have in common.

Pages

ICAP_FRAMES Size and location of frames on page
ICAP_MAXFRAMES Maximum number of frames possible per page
ICAP_SUPPORTEDSIZES Fixed frame sizes for typical page sizes

Paper Handling

CAP_AUTOFEED MSG_SET to TRUE to enable Source's automatic feeding
CAP_CLEARPAGE MSG_SET to TRUE to eject current page and leave acquire area empty
CAP_FEEDERALIGNMENT If TRUE, feeder is centered; FALSE if it is free-floating.
CAP_FEEDERENABLED If TRUE, Source's feeder is available
CAP_FEEDERLOADED If TRUE, Source has documents loaded in feeder (MSG_GET only)
CAP_FEEDERORDER Specifies whether feeder starts with top of the first or last page.
CAP_FEEDPAGE MSG_SET to TRUE to eject current page and feed next page
CAP_PAPERDETECTABLE Determines whether source can detect documents on the ADF or flatbed.
CAP_REACQUIREALLOWED If require is allowed
CAP_REWINDPAGE MSG_SET to TRUE to do a reverse feed

Power Monitoring

CAP_BATTERYMINUTES The minutes of battery power remaining on a device.
CAP_BATTERYPERCENTAGE With MSG_GET, indicates battery power status.
CAP_POWERDOWNTIME With MSG_SET, sets the camera power down timer in seconds; with MSG_GET, returns the current setting of the power down time.
CAP_POWERSUPPLY MSG_GET reports the kinds of power available; MSG_GETCURRENT reports the current power supply to use.

Resolution

ICAP_XNATIVERESOLUTION Native optical resolution of device for x-axis
ICAP_XRESOLUTION Current/Available optical resolutions for x-axis
ICAP_YNATIVERESOLUTION Native optical resolution of device for y-axis
ICAP_YRESOLUTION Current/Available optical resolutions for y-axis

Transfers

CAP_XFERCOUNT Number of images the application is willing to accept during this session
ICAP_IMAGEFILEFORMAT File formats for file transfers
ICAP_TILES Tiled image data
ICAP_XFERMECH Transfer mechanism - used to learn options and set-up for upcoming transfer
ICAP_UNDEFINEDIMAGESIZE The application will accept undefined image size

User Interface

CAP_CAMERAPREVIEWUI Queries the source for UI support for preview mode.
CAP_ENABLEDSUIONLY Queries an application to see if it implements the new user interface settings dialog.
CAP_INDICATORS Use the Source's progress indicator? (valid only when ShowUI==FALSE)
CAP_UICONTROLLABLE Indicates that Source supports acquisitions with UI disabled


CAP_AUTHOR

Description: | The name or other identifying information about the Author of the image.
Remarks: | None.
Data type: | String. The max length is 128.
Default value: | ""
Allowed values: | Any string.
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: |


CAP_AUTOFEED

CAP_AUTOFEED

Description: | If TRUE, the Source will automatically feed the next page from the document feeder after the number of frames negotiated for capture from each page are acquired. CAP_FEEDERENABLED must be TRUE to use this capability.
Remarks: | Set the capability to TRUE to enable the Source's automatic feed process, or FALSE to disable it. After the completion of each transfer, check PendingXFERs determine if the Source has more images to transfer. A -1 means there are more images to transfer but the exact number is not known. CAP_FEEDERLOADED indicates whether the Source's feeder is loaded. (The automatic feed process continues whenever this capability is TRUE.)
Data type: | Boolean
Default value: | No Default.
Allowed values: | TRUE(1) of FALSE(0)
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: | CAP_CLEARPAGE, CAP_FEEDERENABLED, CAP_FEEDERLOADED, CAP_FEEDPAGE, CAP_REWINDPAGE


CAP_AUTOMATICCAPTURE

Description: | The number of images to automatically capture. This does not refer to the number of images to be sent to the Application, use CAP_XFERCOUNT for that.
Remarks: | If 0, Automatic Capture is disabled. If 1 or greater, that number of images is captured by the device.
Data type: | long
Default value: | 0
Allowed values: | 0 or greater
CapType for GET: | TW_ONEVALUE TW_RANGE
CapType for SET: | TW_ONEVALUE TW_RANGE
See also: | CAP_TIMEBEFOREFIRSTCAPTURE, CAP_TIMEBETWEENCAPTURES, CAP_XFERCOUNT


CAP_AUTOSCAN

Description: | This capability is intended to boost the performance of a Source. The fundamental assumption behind AutoScan is that the device is able to capture the number of images indicated by the value of CAP_XFERCOUNT without waiting for the Application to request the image transfers. This is only possible if the device has internal buffers capable of caching the images it captures.
Remarks: | The application should check PendingXFERs, and continue to scan until it becomes 0. When AutoScan is set to TRUE, the Application should not rely on just the paper sensors (for example, CAP_FEEDERLOADED) to determine if there are images to be transferred. The latency between the Source and the Application makes it very likely that at the time the sensor reports FALSE, there may be more than one image waiting for the transfer inside of the device's buffers. Applications should use PendingXFERs to determine whether or not there are more images to be transferred.
Data type: | Boolean
Default value: | No default
Allowed values: | TRUE(1) or FALSE(0)
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: | CAP_AUTOFEED, CAP_CLEARBUFFERS, CAP_MAXBATCHBUFFERS


CAP_BATTERYMINUTES

Description: | The minutes of battery power remaining to the device.
Remarks: | -2 indicates that the available power is infinite. -1 indicates that the device cannot report the remaining battery power. 0 and greater indicates the minutes of battery life remaining.
Data type: | Long
Default value: | No default
Allowed values: | -2, -1, 0, and greater
CapType for GET: | TW_ONEVALUE TW_RANGE
CapType for SET: | Not allowed
See also: | CAP_POWERSUPPLY, CAP_BATTERYPERCENTAGE


CAP_CAMERAPREVIEWUI

Description: | This capability queries the Source for UI support for preview mode. If TRUE, the Source supports preview UI.
Remarks: | Use this capability to query the preview UI support by the Source. However, the application can choose to use the Source's UI or not even if the Source supports it.
Data type: | Boolean
Default value: | No default
Allowed values: | TRUE(1) or FALSE(0)
CapType for GET: | TW_ONEVALUE
CapType for SET: | Not allowed
See also: |


CAP_CAPTION

Description: | A general note about the acquired image.
Remarks: | None.
Data type: | String. The max length is 255.
Default value: | ""
Allowed values: | Any string.
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: | CAP_AUTHOR, CAP_TIMEDATE


CAP_CLEARBUFFERS

Description: | CapGet() reports the presence of data in the scanner's buffers. CapSet() with a value of TWCB_CLEAR immediately clears the buffers.
Remarks: | None.
Data type: | Integer
Default value: | TWCB_AUTO(0)
Allowed values: | TWCB_AUTO 0 TWCB_CLEAR 1 TWCB_NOCLEAR 2
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: | CAP_AUTOSCAN, CAP_MAXBATCHBUFFERS


CAP_CLEARPAGE

Description: | If TRUE, the Source will eject the current page being acquired from and will leave the feeder acquire area empty. If CAP_AUTOFEED is TRUE, a fresh page will be advanced. CAP_FEEDERENABLED must equal TRUE to use this capability. This capability must have been negotiated as an extended capability to be used in States 5 and 6.
Remarks: | Do a CapSet() on this capability to advance the document in the feeder acquire area to the output area and abort all transfers pending on this page. This capability is used in States 5 and 6 by applications controlling the Source's feeder (usually without the Source user interface). This capability can also be used while CAP_AUTOFEED equals TRUE to abort all remaining transfers on this page and continue with the next page.
Data type: | Boolean
Default value: | FALSE
Allowed values: | TRUE(1) or FALSE(0)
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: | CAP_AUTOFEED, CAP_EXTENDEDCAPS, CAP_FEEDERENABLED, CAP_FEEDERLOADED, CAP_FEEDPAGE, CAP_REWINDPAGE


CAP_DEVICEONLINE

Description: | If TRUE, the physical hardware (e.g., scanner, digital camera, image database, etc.) that represents the image source is attached, powered on, and communicating.
Remarks: | This capability can be issued at any time to determine the availability of the image source hardware.
Data type: | Boolean
Default value: | No default
Allowed values: | TRUE(1) or FALSE(0)
CapType for GET: | TW_ONEVALUE
CapType for SET: | Not allowed.
See also: |


CAP_DEVICETIMEDATE

Description: | The date and time of the device's clock. Managed in the form "YYYY/MM/DD HH:mm:SS:sss" where YYYY is the year, MM is the numerical month, DD is the numerical day, HH is the hour, mm is the minute, SS is the second, and sss is the millisecond.
Remarks: | The internal date and time of the device. Be sure to leave the space between the ending of the date and the beginning of the time fields. All fields must be specified for CapSet().
Data type: | String. The max length is 32.
Default value: | No default
Allowed values: | Any date
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: | CAP_TIMEDATE


CAP_DUPLEX

Description: This indicates whether the scanner supports duplex. If so, it further indicates whether one-pass or two-pass duplex is supported.

Remarks: None.

Data type: Integer

Default value: TWDX_NONE(0)

Allowed values: TWDX_NONE(0)

TWDX_1PASSDUPLEX(1)

TWDX_2PASSDUPLEX(2)

CapType for GET: TW_ONEVALUE

CapType for SET: Not Allowed

See also: CAP_DUPLEXENABLED


CAP_DUPLEXENABLED

Description: | The user can set the duplex option to be TRUE or FALSE. If TRUE, the scanner scans both sides of a paper; otherwise, the scanner will scan only one side of the image.
Remarks: | None.
Data type: | Boolean
Default value: | FALSE(0)
Allowed values: | TRUE(1) or FALSE(0)
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: | CAP_DUPLEX


CAP_ENABLEDSUIONLY

Description: | Allows an application to query a source to see if it implements the new user interface settings dialog.
Remarks: | None.
Data type: | Boolean
Default value: | No default
Allowed values: | True or False
CapType for GET: | TW_ONEVALUE
CapType for SET: | Not allowed
See also: |


CAP_ENDORSER

Description: | Allows the application to specify the starting endorser / imprinter number. All other endorser/imprinter properties should be handled through the data source's user interface. The user can set the starting number for the endorser.
Remarks: | None.
Data type: | Long
Default value: | 0
Allowed values: | Any value
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: |


CAP_EXTENDEDCAPS

Description: Allows the application and Source to negotiate capabilities to be used in States 5 and 6.

Remarks: CapGetCurrent() provides a list of all capabilities which the Source and application have agreed to negotiate in States 5 and 6.

CapGet() provides a list of all capabilities the Source is willing to negotiate in States 5 and 6.

CapSet() specifies which capabilities the application wants to negotiate in States 5 and 6.

Data type: Integer

Default value: No default

Allowed values: Any capabilities

CapType for GET: TW_ARRAY

CapType for SET: TW_ARRAY

See also: CAP_SUPPORTEDCAPS


CAP_FEEDERALIGNMENT

Description: | Helps the Application determine any special actions it may need to take when negotiating frames with the Source. TWFA_NONE: The alignment is free-floating. Applications should assume that the origin for frames is on the left. TWFA_LEFT: The alignment is to the left. TWFA_CENTER: The alignment is centered. This means that the paper will be fed in the middle of the ICAP_PHYSICALWIDTH of the device. If this is set, then the Application should calculate any frames with a left offset of zero. TWFA_RIGHT: The alignment is to the right.
Remarks: | The Application can use this to determine if it must center the framing information sent to the Source. With some Sources it might be possible for the Application to select whether the paper is center fed or not.
Data type: | Integer
Default value: | No default
Allowed values: | TWFA_NONE(0), TWFA_LEFT(1), TWFA_CENTER(2), TWFA_RIGHT(3)
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE, if supported
See also: | None


CAP_FEEDERENABLED

Description:

If TRUE, Source must acquire data from the document feeder acquire area and other feeder capabilities can be used. If FALSE, Source must acquire data from the non-feeder acquire area and no other feeder capabilities can be used.

Remarks:

The application should CapSet() this capability to TRUE before attempting to use any other feeder capabilities. This sets the current acquire area to the feeder area (it may not be a different physical area on some Sources).

The application can CapSet() this capability to FALSE to use the Source's non-feeder acquisition area and disallow the further use of feeder capabilities.

Data type:

Boolean

Default value:

No default

Allowed values: TRUE(1) or FALSE(0)

CapType for GET: TW_ONEVALUE

CapType for SET: TW_ONEVALUE

See also: CAP_AUTOFEED, CAP_CLEARPAGE, CAP_FEEDERLOADED, CAP_FEEDPAGE, CAP_REWINDPAGE


CAP_FEEDERLOADED

Description: | Reflect whether there are documents loaded in the Source's feeder.
Remarks: | CAP_FEEDERENABLED must equal TRUE to use this capability.
Data type: | Boolean
Default value: | No default
Allowed values: | TRUE(1) or FALSE(0)
CapType for GET: | TW_ONEVALUE
CapType for SET: | Not allowed
See also: | CAP_AUTOFEED, CAP_CLEARPAGE, CAP_FEEDERENABLED, CAP_FEEDPAGE, CAP_REWINDPAGE


CAP_FEEDERORDER

Description: | TWFO_FIRSTPAGEFIRST indicates the feeder starts with the top of the first page. TWFO_LASTPAGEFIRST indicates the feeder starts with the top of the last page.
Remarks: | An Application can use this to determine if it should reorganize the stream of images received from a Source. of the last page.
Data type: | Integer
Default value: | No default
Allowed values: | TWFO_FIRSTPAGEFIRST(0), TWFO_LASTPAGEFIRST(1)
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE, if supported
See also: | CAP_FEEDERENABLED


CAP_FEEDPAGE

Description: | If TRUE, the Source will eject the current page and advance the next page in the document feeder into the feeder acquire area. If CAP_AUTOFEED is TRUE, the same action just described will occur and CAP_AUTOFEED will remain active. CAP_FEEDERENABLED must equal TRUE to use this capability. This capability must have been negotiated as an extended capability to be used in States 5 and 6.
Remarks: | Do a CapSet() to TRUE on this capability to advance the next document in the feeder to the feeder acquire area. This capability is used in States 5 and 6 by applications controlling the Source's feeder (usually without the Source's user interface). This capability can also be used while CAP_AUTOFEED equals TRUE to abort all remaining transfers on this page and continue with the next page.
Data type: | Boolean
Default value: | FALSE(0)
Allowed values: | TRUE(1) or FALS(0)
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: | CAP_AUTOFEED, CAP_CLEARPAGE, CAP_EXTENDEDCAPS, CAP_FEEDERENABLED, CAP_FEEDERLOADED, CAP_REWINDPAGE


CAP_INDICATORS

Description: | If TRUE, the Source will display a progress indicator during acquisition and transfer, regardless of whether the Source's user interface is active. If FALSE, the progress indicator will be suppressed if the Source's user interface is inactive. The Source will continue to display device-specific instructions and error messages even with the Source user interface and progress indicators turned off.
Remarks: | None
Data type: | Boolean
Default value: | TRUE(1)
Allowed values: | TRUE(1) or FALSE(0)
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: |


CAP_LANGUAGE

Description:

Allows Application and Source to identify which languages they have in common for the exchange of string data, and to select the language of the internal UI.

Remarks:

In multi-lingual environments, it is the responsibility of the Application to recall the last selected language for a given User.

Data type:

Integer

Default value:

TWLG_USERLOCALE(-1)

Allowed values: TWLG_USERLOCALE(-1), TWLG_DAN(0), TWLG_DUT(1), TWLG_ENG(2), TWLG_FCF(3), TWLG_FIN(4), TWLG_FRN(5), TWLG_GER(6), TWLG_ICE(7), TWLG_ITN(8), TWLG_NOR(9), TWLG_POR(10), TWLG_SPA(11), TWLG_SWE(12), TWLG_USA(13), TWLG_AFRIKAANS(14), TWLG_ALBANIA(15), TWLG_ARABIC(16), TWLG_ARABIC_ALGERIA(17), TWLG_ARABIC_BAHRAIN(18), TWLG_ARABIC_EGYPT(19), TWLG_ARABIC_IRAQ(20), TWLG_ARABIC_JORDAN(21), TWLG_ARABIC_KUWAIT(22), TWLG_ARABIC_LEBANON(23), TWLG_ARABIC_LIBYA(24), TWLG_ARABIC_MOROCCO(25), TWLG_ARABIC_OMAN(26), TWLG_ARABIC_QATAR(27), TWLG_ARABIC_SAUDIARABIA(28), TWLG_ARABIC_SYRIA(29), TWLG_ARABIC_TUNISIA(30), TWLG_ARABIC_UAE(31), TWLG_ARABIC_YEMEN,(32), TWLG_BASQUE(33), TWLG_BYELORUSSIAN(34), TWLG_BULGARIAN(35), TWLG_CATALAN(36), TWLG_CHINESE(37), TWLG_CHINESE_HONGKONG(38), TWLG_CHINESE_PRC(39), TWLG_CHINESE_SINGAPORE(40), TWLG_CHINESE_SIMPLIFIED(41), TWLG_CHINESE_TAIWAN(42), TWLG_CHINESE_TRADITIONAL(43), TWLG_CROATIA(44), TWLG_CZECH(45), TWLG_DANISH(TWLG_DAN), TWLG_DUTCH(TWLG_DUT), TWLG_DUTCH_BELGIAN(46), TWLG_ENGLISH(TWLG_ENG), TWLG_ENGLISH_AUSTRALIAN(47), TWLG_ENGLISH_CANADIAN(48), TWLG_ENGLISH_IRELAND(49), TWLG_ENGLISH_NEWZEALAND(50), TWLG_ENGLISH_SOUTHAFRICA(51), TWLG_ENGLISH_UK(52), TWLG_ENGLISH_USA(TWLG_USA), TWLG_ESTONIAN(53), TWLG_FAEROESE(54), TWLG_FARSI(55), TWLG_FINNISH(TWLG_FIN), TWLG_FRENCH(TWLG_FRN), TWLG_FRENCH_BELGIAN(56), TWLG_FRENCH_CANADIAN(TWLG_FCF), TWLG_FRENCH_LUXEMBOURG(57), TWLG_FRENCH_SWISS(58), TWLG_GERMAN(TWLG_GER), TWLG_GERMAN_AUSTRIAN(59), TWLG_GERMAN_LUXEMBOURG(60), TWLG_GERMAN_LIECHTENSTEIN(61), TWLG_GERMAN_SWISS(62), TWLG_GREEK(63), TWLG_HEBREW(64), TWLG_HUNGARIAN(65), TWLG_ICELANDIC(TWLG_ICE), TWLG_INDONESIAN(66), TWLG_ITALIAN(TWLG_ITN), TWLG_ITALIAN_SWISS(67), TWLG_JAPANESE(68), TWLG_KOREAN(69), TWLG_KOREAN_JOHAB(70), TWLG_LATVIAN(71), TWLG_LITHUANIAN(72), TWLG_NORWEGIAN(TWLG_NOR), TWLG_NORWEGIAN_BOKMAL(73), TWLG_NORWEGIAN_NYNORSK(74), TWLG_POLISH(75), TWLG_PORTUGUESE(TWLG_POR), TWLG_PORTUGUESE_BRAZIL(76), TWLG_ROMANIAN(77), TWLG_RUSSIAN(78), TWLG_SERBIAN_LATIN(79), TWLG_SLOVAK(80), TWLG_SLOVENIAN(81), TWLG_SPANISH(TWLG_SPA), TWLG_SPANISH_MEXICAN(82), TWLG_SPANISH_MODERN(83), TWLG_SWEDISH(TWLG_SWE), TWLG_THAI(84), TWLG_TURKISH(85), TWLG_UKRANIAN(86), TWLG_ASSAMESE(87), TWLG_BENGALI(88), TWLG_BIHARI(89), TWLG_BODO(90), TWLG_DOGRI(91), TWLG_GUJARATI(92), TWLG_HARYANVI(93), TWLG_HINDI(94), TWLG_KANNADA(95), TWLG_KASHMIRI(96), TWLG_MALAYALAM(97), TWLG_MARATHI(98), TWLG_MARWARI(99), TWLG_MEGHALAYAN(100), TWLG_MIZO(101), TWLG_NAGA(102), TWLG_ORISSI(103), TWLG_PUNJABI(104), TWLG_PUSHTU(105), TWLG_SERBIAN_CYRILLIC(106), TWLG_SIKKIMI(107), TWLG_SWEDISH_FINLAND(108), TWLG_TAMIL(109), TWLG_TELUGU(110), TWLG_TRIPURI(111), TWLG_URDU(112), TWLG_VIETNAMESE(113)

CapType for GET: TW_ENUMERATION, TW_ONEVALUE

CapType for SET: TW_ENUMERATION, TW_ONEVALUE

See also:


CAP_MAXBATCHBUFFERS

Description: | Describes the number of pages that the scanner can buffer when CAP_AUTOSCAN is enabled.
Remarks: | None.
Data type: | Long
Default value: | No default
Allowed values: | 1 to 2Exp(32)-1
CapType for GET: | TW_ONEVALUE, TW_ENUMERATION, TW_RANGE
CapType for SET: | TW_ONEVALUE
See also: | CAP_AUTOSCAN, CAP_CLEARBUFFERS


CAP_PAPERDETECTABLE

Description: | This capability determines whether the device has a paper sensor that can detect documents on the ADF or Flatbed.
Remarks: | If the source returns FALSE, the application should not rely on values such as CAP_FEEDERLOADED, and continue as if the paper is loaded.
Data type: | Boolean
Default value: | TRUE(1)
Allowed values: | TRUE(1) or FALSE(0)
CapType for GET: | TW_ONEVALUE
CapType for SET: | Not allowed
See also: | CAP_FEEDERLOADED


CAP_POWERDOWNTIME

Description: | When used with CapSet(), sets the camera power down timer in seconds. When used with CapGet(), returns the current setting of the power down time.
Remarks: | Use this capability with CapSet() to set the user selected camera power down time, when no activity is detected by the camera. The default value of -1 means no power down, power is always on.
Data type: | Long
Default value: | -1
Allowed values: | >= -1
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: |


CAP_POWERSUPPLY

Description: | CapGet() reports the kinds of power available to the device. CapGetCurrent() reports the current power supply in use.
Remarks: | None
Data type: | Integer
Default value: | No default
Allowed values: | TWPS_EXTERNAL(0), TWPS_BATTERY(1)
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE
CapType for SET: | Not allowed
See also: |


CAP_PRINTER

Description: | CapGet() returns the current list of available printer devices, along with the one currently being used for negotiation. CapSet() selects the current device for negotiation, and optionally constrains the list. Top/Bottom refers to duplex devices, and indicates if the printer is writing on the top or the bottom of the sheet of paper. Simplex devices use the top settings. Before/After indicates whether printing occurs before or after the sheet of paper has been scanned.
Remarks: | Use this capability to determine which printers are available for negotiation, and to select a specific printer prior to negotiation.
Data type: | Integer
Default value: | No default
Allowed values: | TWPR_IMPRINTERTOPBEFORE(0), TWPR_IMPRINTERTOPAFTER(1), TWPR_IMPRINTERBOTTOMBEFORE(2), TWPR_IMPRINTERBOTTOMAFTER(3), TWPR_ENDORSERTOPBEFORE(4), TWPR_ENDORSERTOPAFTER(5), TWPR_ENDORSERBOTTOMBEFORE(6), TWPR_ENDORSERBOTTOMAFTER(7)
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE
CapType for SET: | TW_ENUMERATION, TW_ONEVALUE
See also: | CAP_PRINTERENABLED, CAP_PRINTERINDEX, CAP_PRINTERMODE, CAP_PRINTERSTRING, CAP_PRINTERSUFFIX


CAP_PRINTERENABLED

Description: | Turns the current CAP_PRINTER device on or off.
Remarks: | None.
Data type: | Boolean
Default value: | FALSE(0)
Allowed values: | TRUE(1), FALSE(0)
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: | CAP_PRINTER, CAP_PRINTERINDEX, CAP_PRINTERMODE, CAP_PRINTERSTRING, CAP_PRINTERSUFFIX


CAP_PRINTERINDEX

Description: | The User can set the starting number for the current CAP_PRINTER device.
Remarks: | None.
Data type: | Long
Default value: | 0
Allowed values: | Any values
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: | CAP_PRINTER, CAP_PRINTERENABLED, CAP_PRINTERMODE, CAP_PRINTERSTRING, CAP_PRINTERSUFFIX


CAP_PRINTERMODE

Description: | Specifies the appropriate current CAP_PRINTER device mode. Note: TWPM_SINGLESTRING specifies that the printed text will consist of a single string. WPM _MULTISTRING specifies that the printed text will consist of an enumerated list of strings to be printed in order. TWPM _COMPOUNDSTRING specifies that the printed string will consist of a compound of a String followed by a value followed by a suffix string.
Remarks: | None
Data type: | Integer
Default value: | TWPM_SINGLESTRING(0)
Allowed values: | TWPM_SINGLESTRING(0), TWPM_MULTISTRING(1), TWPM_COMPOUNDSTRING(2)
CapType for GET: | TW_ENUMERATION. TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: | CAP_PRINTER, CAP_PRINTERENABLED, CAP_PRINTERINDEX, CAP_PRINTERSTRING, CAP_PRINTERSUFFIX


CAP_PRINTERSTRING

Description: | Specifies the string(s) that are to be used in the string component when the current CAP_PRINTER device is enabled.
Remarks: | Negotiate this capability to specify the string or strings to be used for printing (depending on printer mode). Use enumeration to print multiple lines of text, one line per string in the enumerated list.
Data type: | String. The max length is 255.
Default value: | No default
Allowed values: | Any string
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE
CapType for SET: | TW_ENUMERATION, TW_ONEVALUE
See also: | CAP_PRINTER, CAP_PRINTERENABLED, CAP_PRINTERINDEX, CAP_PRINTERMODE, CAP_PRINTERSUFFIX


CAP_PRINTERSUFFIX

Description: | Specifies the string that shall be used as the current CAP_PRINTER device's suffix.
Remarks: | Negotiate this capability to specify the string that is used as the suffix for printing if TWPM_COMPOUNDSTRING is used.
Data type: | String. The max length is 255.
Default value: | No default
Allowed values: | Any string
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: | CAP_PRINTER, CAP_PRINTERENABLED, CAP_PRINTERINDEX, CAP_PRINTERMODE, CAP_PRINTERSTRING


CAP_REACQUIREALLOWED

Description: | Indicates whether the physical hardware (e.g. scanner, digital camera) is capable of acquiring multiple images of the same page without changes to the physical registration of that page.
Remarks: | Use this capability to enable or disable modes of operation where multiple image acquisitions of the page are required. Examples: preview mode, automated image analysis mode.
Data type: | Boolean
Default value: | No default
Allowed values: | TRUE(1) or FALSE(0)
CapType for GET: | TW_ONEVALUE
CapType for SET: | Not allowed
See also: | CAP_AUTOFEED, CAP_CLEARPAGE, CAP_FEEDERENABLED, CAP_FEEDPAGE, CAP_REWINDPAGE


CAP_REWINDPAGE

Description: | If TRUE, the Source will return the current page to the input side of the document feeder and feed the last page from the output side of the feeder back into the acquisition area. If CAP_AUTOFEED is TRUE, automatic feeding will continue after all negotiated frames from this page are acquired. CAP_FEEDERENABLED must equal TRUE to use this capability. This capability must have been negotiated as an extended capability to be used in States 5 and 6.
Remarks: | This capability is used in States 5 and 6 by applications controlling the Source's feeder (usually without the Source's user interface). If CAP_AUTOFEED is TRUE, the normal automatic feeding will continue after all frames of this page are acquired.
Data type: | Boolean
Default value: | FALSE(0)
Allowed values: | TRUE(1) or FALSE(0)
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: | CAP_AUTOFEED, CAP_CLEARPAGE, CAP_EXTENDEDCAPS, CAP_FEEDERENABLED, CAP_FEEDERLOADED, CAP_FEEDPAGE


CAP_SERIALNUMBER

Description: | A string containing the serial number of the currently selected device in the Source. Multiple devices may all report the same serial number.
Remarks: | The value is device specific. Applications should not attempt to parse the information.
Data type: | String. The max length is 255.
Default value: | No default
Allowed values: | Any string
CapType for GET: | TW_ONEVALUE
CapType for SET: | Not allowed
See also: |


CAP_SUPPORTEDCAPS

Description: | Returns a list of all the capabilities for which the Source will answer inquiries. Does not indicate which capabilities the Source will allow to be set by the application. Some capabilities can only be set if certain setup work has been done so the Source cannot globally answer which capabilities are "set-able."
Remarks: | None
Data type: | Integer
Default value: | No default
Allowed values: | Any "get-able" capabilities
CapType for GET: | TW_ARRAY
CapType for SET: | Not allowed
See also: | CAP_EXTENDEDCAPS


CAP_THUMBNAILSENABLED

Description: | Allows an application to request the delivery of thumbnail representations for the set of images that are to be delivered. Setting CAP_THUMBNAILSENABLED to TRUE turns on thumbnail mode. Images transferred thereafter will be sent at thumbnail size (exact thumbnail size is determined by the Data Source). Setting this capability to FALSE turns thumbnail mode off and returns full size images.
Remarks: | A successful set of this capability to TRUE will cause the Source to deliver image thumbnails during normal data transfer operations. This mode remains in effect until this capability is set back to FALSE.
Data type: | Boolean
Default value: | FALSE(0)
Allowed values: | TRUE(1) or FALSE(0)
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: |


CAP_TIMEBEFOREFIRSTCAPTURE

Description: | For automatic capture, this value selects the number of milliseconds before the first picture is to be taken, or the first image is to be scanned.
Remarks: | None
Data type: | Long
Default value: | 0
Allowed values: | 0 or greater
CapType for GET: | TW_ONEVALUE, TW_RANGE
CapType for SET: | TW_ONEVALUE, TW_RANGE
See also: | CAP_AUTOMATICCAPTURE, CAP_TIMEBETWEENCAPTURES, CAP_XFERCOUNT


CAP_TIMEBETWEENCAPTURES

Description: | For automatic capture, this value selects the milliseconds to wait between pictures taken, or images scanned.
Remarks: | None
Data type: | Long
Default value: | 0
Allowed values: | 0 or greater
CapType for GET: | TW_ONEVALUE, TW_RANGE
CapType for SET: | TW_ONEVALUE, TW_RANGE
See also: | CAP_AUTOMATICCAPTURE, CAP_TIMEBEFOREFIRSTCAPTURE, CAP_XFERCOUNT


CAP_TIMEDATE

Description: | The date and time the image was acquired. Stored in the form "YYYY/MM/DD HH:mm:SS.sss" where YYYY is the year, MM is the numerical month, DD is the numerical day, HH is the hour, mm is the minute, SS is the second, and sss is the millisecond.
Remarks: | CAP_TIMEDATE does not return the exact time the image was acquired; rather, it returns the closest available approximation of the time when the physical phenomena represented by the image was recorded. If the application needs the exact time of acquisition, the application should generate that value itself during the image acquisition procedure.
Data type: | String. The max length is 32.
Default value: | No default
Allowed values: | Any date time
CapType for GET: | TW_ONEVALUE
CapType for SET: | Not allowed
See also: | CAP_AUTHOR, CAP_CAPTION


CAP_UICONTROLLABLE

Description: | If TRUE, indicates that this Source supports acquisition with the UI disabled. If FALSE, indicates that this Source can only support acquisition with the UI enabled.
Remarks: | None
Data type: | Boolean
Default value: | No default
Allowed values: | TRUE(1) or FALSE(0)
CapType for GET: | TW_ONEVALUE
CapType for SET: | Not allowed
See also: | CAP_INDICATORS


CAP_XFERCOUNT

Description: | The application is willing to accept this number of images.
Remarks: | Set this capability to the number of images you are willing to transfer per session. Common values are: 1 Application wishes to transfer only one image during this session -1 Application is willing to transfer multiple images
Data type: | Integer
Default value: | -1
Allowed values: | -1 to 2Exp(15)
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: |


ICAP_AUTOBRIGHT

Description: | TRUE enables and FALSE disables the Source's Auto-brightness function (if any).
Remarks: | None.
Data type: | Boolean
Default value: | FALSE(0)
Allowed values: | TRUE(1) or FALSE(0)
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: | ICAP_BRIGHTNESS


ICAP_AUTODISCARDBLANKPAGES

Description: | Use this capability to have the Source discard blank images. The Application never sees these images during the scanning session. TWBP_DISABLE This must be the default state for the Source. It indicates that all images will be delivered to the Application, none of them will be discarded. TWBP_AUTO If this is used, then the Source will decide if an image is blank or not and discard as appropriate. If the specified value is a positive number in the range 0 to 2EXP(31), then this capability will use it as the byte size cutoff point to identify which images are to be discarded. If the size of the image is less than or equal to this value, then it will be discarded. If the size of the image is greater than this value, then it will be kept so that it can be transferred to the Application.
Remarks: | None
Data type: | Long
Default value: | TW_DISABLE(-2)
Allowed values: | TWBP_DISABLE(-2), TWBP_AUTO(-1), 0 to 2Exp(31)-1
CapType for GET: | TW_ONEVALUE, TW_RANGE
CapType for SET: | TW_ONEVALUE, TW_RANGE
See also: |


ICAP_AUTOMATICBORDERDETECTION

Description: | Turns automatic border detection on or off.
Remarks: | None
Data type: | Boolean
Default value: | FALSE(0)
Allowed values: | TRUE(1) or FALSE(0)
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: | ICAP_UNDEFINEDIMAGESIZE, ICAP_AUTOMATICDESKEW


ICAP_AUTOMATICDESKEW

Description: | Turns automatic deskew correction on or off.
Remarks: | None
Data type: | Boolean
Default value: | FALSE(0)
Allowed values: | TRUE(1) or FALSE(0)
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: | ICAP_AUTOMATICBORDERDETECTION, ICAP_AUTOMATICROTATE, ICAP_UNDEFINEDIMAGESIZE


ICAP_AUTOMATICROTATE

Description: | When TRUE this capability depends on intelligent features within the Source to automatically rotate the image to the correct position.
Remarks: | If this capability is set to TRUE, then it must be assumed that no other correction is required (deskew, rotation, etc…); the Source is guaranteeing that it will deliver images in the correct orientation.
Data type: | Boolean
Default value: | FALSE(0)
Allowed values: | TRUE(1) or FALSE(0)
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: | ICAP_AUTOMATICDESKEW, ICAP_ORIENTATION, ICAP_ROTATION


ICAP_BITDEPTH

Description: | Specifies the pixel bit depths for the Current value of ICAP_PIXELTYPE. For example, when using ICAP_PIXELTYPE = TWPT_GRAY, this capability specifies whether this is 8-bit gray or 4-bit gray. This depth applies to all the data channels (for instance, the R, G, and B channels will all have the same bit depth for RGB data).
Remarks: | None
Data type: | Integer
Default value: | No default
Allowed values: | > = 1
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE
CapType for SET: | TW_ENUMERATION, TW_ONEVALUE
See also: | ICAP_PIXELTYPE


ICAP_BITDEPTHREDUCTION

Description: | Specifies the Reduction Method the Source should use to reduce the bit depth of the data. Most commonly used with ICAP_PIXELTYPE = TWPT_BW to reduce gray data to black and white.
Remarks: | None.
Data type: | Integer
Default value: | No default
Allowed values: | TWBR_THRESHOLD(0), TWBR_HALFTONES(1), TWBR_CUSTHALFTONE(2), TWBR_DIFFUSION(3)
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE
CapType for SET: | TW_ENUMERATION, TW_ONEVALUE
See also: | ICAP_CUSTHALFTONE, ICAP_HALFTONES, ICAP_PIXELTYPE, ICAP_THRESHOLD


ICAP_BITORDER

Description: | Specifies how the bytes in an image are filled by the Source. TWBO_MSBFIRST indicates that the leftmost bit in the byte (usually bit 7) is the byte's Most Significant Bit.
Remarks: | None
Data type: | Integer
Default value: | TWBO_MSBFIRST(1)
Allowed values: | TWBO_LSBFIRST(0), TWBO_MSBFIRST(1)
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: |


ICAP_BRIGHTNESS

Description: | The brightness values available within the Source.
Remarks: | The application can use this capability to inquire, set, or restrict the values for BRIGHTNESS used in the Source.
Data type: | Single (float)
Default value: | 0
Allowed values: | -1000 to +1000
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE, TW_RANGE
CapType for SET: | TW_ENUMERATION, TW_ONEVALUE, TW_RANGE
See also: | ICAP_AUTOBRIGHT, ICAP_CONTRAST


ICAP_CONTRAST

Description: | The contrast values available within the Source.
Remarks: | The application can use this capability to inquire, set or restrict the values for CONTRAST used in the Source.
Data type: | Single (float)
Default value: | 0
Allowed values: | -1000 to +1000
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE, TW_RANGE
CapType for SET: | TW_ENUMERATION, TW_ONEVALUE, TW_RANGE
See also: | ICAP_BRIGHTNESS


ICAP_CUSTHALFTONE

Description: | Specifies the square-cell halftone (dithering) matrix the Source should use to halftone the image.
Remarks: | The application should also set ICAP_BITDEPTHREDUCTION to TWBR_CUSTHALFTONE to use this capability.
Data type: | Integer
Default value: | No default
Allowed values: | Any rectangular array
CapType for GET: | TW_ARRAY
CapType for SET: | TW_ARRAY
See also: | ICAP_BITDEPTHREDUCTION


ICAP_EXPOSURETIME

Description: | Specifies the exposure time used to capture the image, in seconds.
Remarks: | None
Data type: | Single (float)
Default value: | No default
Allowed values: | > 0
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE, TW_RANGE
CapType for SET: | TW_ENUMERATION, TW_ONEVALUE, TW_RANGE
See also: | ICAP_FLASHUSED2, ICAP_LAMPSTATE, ICAP_LIGHTPATH, ICAP_LIGHTSOURCE


ICAP_FILTER

Description: | Describes the color characteristic of the subtractive filter applied to the image data. Multiple filters may be applied to a single acquisition.
Remarks: | None
Data type: | Integer
Default value: | No default
Allowed values: | TWFT_RED(0), TWFT_GREEN(1), TWFT_BLUE(2), TWFT_NONE(3), TWFT_WHITE(4), TWFT_CYAN(5), TWFT_MAGENTA(6), TWFT_YELLOW(7), TWFT_BLACK(8)
CapType for GET: | TW_ARRAY, TW_ONEVALUE
CapType for SET: | TW_ARRAY, TW_ONEVALUE
See also: |


ICAP_FLASHUSED

Description: | Specifies whether or not the image was acquired using a flash.
Remarks: | Note that an image with flash may have a different color composition than an image without flash.
Data type: | Boolean
Default value: | No default
Allowed values: | TRUE(1) or FALSE(0)
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: | ICAP_EXPOSURETIME, ICAP_FLASHUSED2, ICAP_LAMPSTATE, ICAP_LIGHTPATH, ICAP_LIGHTSOURCE


ICAP_FLASHUSED2

Description: | For devices that support flash. CapSet() selects the flash to be used (if any). CapGet() reports the current setting. This capability replaces ICAP_FLASHUSED, which is only able to negotiate the flash being on or off.
Remarks: | Note that an image with flash may have a different color composition than an image without flash.
Data type: | Integer
Default value: | TWFL_NONE(0)
Allowed values: | TWFL_NONE(0), TWFL_OFF(1), TWFL_ON(2), TWFL_AUTO(3), TWFL_REDEYE(4)
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE
CapType for SET: | TW_ENUMERATION, TW_ONEVALUE
See also: | ICAP_FLASHUSED


ICAP_FLIPROTATION

Description: | Flip rotation is used to properly orient images that flip orientation every other image. TWFR_BOOK The images to be scanned are viewed in book form, flipping each page from left to right or right to left. TWFR_FANFOLD The images to be scanned are viewed in fanfold paper style, flipping each page up or down.
Remarks: | None
Data type: | Integer
Default value: | TWFR_BOOK(0)
Allowed values: | TWFR_BOOK(0), TWFR_FANFOLD(1)
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: |


ICAP_FRAMES

Description:

The list of frames the Source will acquire on each page.

Remarks:

CapGet() returns the size and location of all the frames the Source will acquire image data from when acquiring from each page.

CapGetCurrent() returns the size and location of the next frame to be acquired.

CapSet() allows the application to specify the frames and their locations to be used to acquire from future pages.

This ICAP is most useful if the Source supports simultaneous acquisition from multiple frames.

Use ICAP_MAXFRAMES to establish this ability.
Data type:

4 Singles(float)

Default value:

No default

Allowed values:

Device dependent

CapType for GET:

TW_ENUMERATION, TW_ONEVALUE

CapType for SET:

TW_ENUMERATION, TW_ONEVALUE

See also:

ICAP_MAXFRAMES, ICAP_SUPPORTEDSIZES, CapGetFrameLeft(), CapGetFrameTop(), CapGetFrameRight(), CapGetFrameBottom(), CapSetFrame()


ICAP_GAMMA

Description: | Gamma correction value for the image data.
Remarks: | None.
Data type: | Single(float)
Default value: | 2.2
Allowed values: | Any value
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: |


ICAP_HALFTONES

Description: | A list of names of the halftone patterns available within the Source.
Remarks: | The application may not rename any halftone pattern. The application should also set ICAP_BITDEPTHREDUCTION to use this capability.
Data type: | String. The max length is 32.
Default value: | No default
Allowed values: | Any halftone name
CapType for GET: | TW_ARRAY, TW_ENUMERATION, TW_ONEVALUE
CapType for SET: | TW_ARRAY, TW_ENUMERATION, TW_ONEVALUE
See also: | ICAP_CUSTHALFTONE, ICAP_BITDEPTHREDUCTION, ICAP_THRESHOLD


ICAP_HIGHLIGHT

Description: | Specifies which value in an image should be interpreted as the lightest "highlight". All values "lighter" than this value will be clipped to this value. Whether lighter values are smaller or larger can be determined by examining the Current value of ICAP_PIXELFLAVOR.
Remarks: | None
Data type: | Single(float)
Default value: | 255
Allowed values: | 0 to 255
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE, TW_RANGE
CapType for SET: | TW_ENUMERATION, TW_ONEVALUE, TW_RANGE
See also: | ICAP_SHADOW


ICAP_IMAGEFILEFORMAT

Description: | Informs the application which file formats the Source can generate (CapGet()). Tells the Source which file formats the application can handle (CapSet()). TWFF_TIFF Used for document imaging TWFF_PICT Native Macintosh format TWFF_BMP Native Microsoft format TWFF_XBM Used for document imaging TWFF_JFIF Wrapper for JPEG images TWFF_FPX FlashPix, used with digital cameras TWFF_TIFFMULTI Multi-page TIFF files TWFF_PNG An image format standard intended for use on the web, replaces GIF TWFF_SPIFF A standard from JPEG, intended to replace JFIF, also supports JBIG TWFF_EXIF File format for use with digital cameras.
Remarks: | None
Data type: | Integer
Default value: | TWFF_BMP(2)
Allowed values: | TWFF_TIFF(0), TWFF_PICT(1), TWFF_BMP(2), TWFF_XBM(3), TWFF_JFIF(4), TWFF_FPX(5), TWFF_TIFFMULTI(6), TWFF_PNG(7), TWFF_SPIFF(8), TWFF_EXIF(9)
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE
CapType for SET: | TW_ENUMERATION, TW_ONEVALUE
See also: |


ICAP_IMAGEFILTER

Description: | For devices that support image enhancement filtering. This capability selects the algorithm used to improve the quality of the image.
Remarks: | TWIF_LOWPASS is good for halftone images. TWIF_BANDPASS is good for improving text. TWIF_HIGHPASS is good for improving fine lines.
Data type: | Integer
Default value: | TWIF_NONE(0)
Allowed values: | TWIF_NONE(0), TWIF_AUTO(1), TWIF_LOWPASS(2), TWIF_BANDPASS(3), TWIF_HIGHPASS(4)
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE
CapType for SET: | TW_ENUMERATION, TW_ONEVALUE
See also: |


ICAP_LAMPSTATE

Description: | TRUE means the lamp is currently, or should be set to ON. Sources may not support CapSet() operations.
Remarks: | None
Data type: | Boolean
Default value: | No default
Allowed values: | TRUE(1) or FALSE(0)
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: | ICAP_EXPOSURETIME, ICAP_FLASHUSED2, ICAP_LIGHTPATH, ICAP_LIGHTSOURCE


ICAP_LIGHTPATH

Description: | Describes whether the image was captured transmissively or reflectively.
Remarks: | None
Data type: | Integer
Default value: | No default
Allowed values: | TWLP_REFLECTIVE(0), TWLP_TRANSMISSIVE(1)
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: | ICAP_EXPOSURETIME, ICAP_FLASHUSED2, ICAP_LAMPSTATE, ICAP_LIGHTSOURCE


ICAP_LIGHTSOURCE

Description: | Describes the general color characteristic of the light source used to acquire the image.
Remarks: | None.
Data type: | Integer
Default value: | No default
Allowed values: | TWLS_RED(0), TWLS_GREEN(1), TWLS_BLUE(2), TWLS_NONE(3), TWLS_WHITE(4), TWLS_UV(5), TWLS_IR(6)
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE
CapType for SET: | TW_ENUMERATION, TW_ONEVALUE
See also: | ICAP_EXPOSURETIME, ICAP_FLASHUSED2, ICAP_LAMPSTATE, ICAP_LIGHTPATH


ICAP_MAXFRAMES

Description: | The maximum number of frames the Source can provide or the application can accept per page. This is a bounding capability only. It does not establish current or future behavior.
Remarks: | None.
Data type: | Integer
Default value: | No default
Allowed values: | 1to 2Exp(16)
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: | ICAP_FRAMES


ICAP_MINIMUMHEIGHT

Description: | Allows the source to define the minimum height (Y-axis) that the source can acquire.
Remarks: | None.
Data type: | Single(float)
Default value: | No default
Allowed values: | 0 to 32767 in ICAP_UNITS
CapType for GET: | TW_ONEVALUE
CapType for SET: | Not allowed
See also: | CAP_FEEDERENABLED, ICAP_PHYSICALHEIGHT, ICAP_UNITS


ICAP_MINIMUMWIDTH

Description: | Allows the source to define the minimum width (X-axis) that the source can acquire.
Remarks: | None
Data type: | Single(float)
Default value: | No default
Allowed values: | 0 to 32767 in ICAP_UNITS
CapType for GET: | TW_ONEVALUE
CapType for SET: | Not allowed
See also: | CAP_FEEDERENABLED, ICAP_PHYSICALWIDTH, ICAP_UNITS


ICAP_NOISEFILTER

Description: | For devices that support noise filtering. This capability selects the algorithm used to remove noise.
Remarks: | None.
Data type: | Integer
Default value: | TWNF_NONE(0)
Allowed values: | TWNF_NONE(0), TWNF_AUTO(1), TWNF_LONEPIXEL(2), TWNF_MAJORITYRULE(3)
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE
CapType for SET: | TW_ENUMERATION, TW_ONEVALUE
See also: |


ICAP_ORIENTATION

Description:

Defines which edge of the "paper" the image's "top" is aligned with. This information is used to adjust the frames to match the scanning orientation of the paper. For instance, if an ICAP_SUPPORTEDSIZE of TWSS_ISOA4 has been negotiated, and ICAP_ORIENTATION is set to TWOR_LANDSCAPE, then the Source must rotate the frame it downloads to the scanner to reflect the orientation of the paper. Please note that setting ICAP_ORIENTATION does not affect the values reported by ICAP_FRAMES; it just causes the Source to use them in a different way.

The upper-left of the image is defined as the location where both the primary and secondary scans originate. (The X axis is the primary scan direction and the Y axis is the secondary scan direction.) For a flatbed scanner, the light bar moves in the secondary scan direction. For a handheld scanner, the scanner is drug in the secondary scan direction. For a digital camera, the secondary direction is the vertical axis when the viewed image is considered upright.

Remarks:

If one pivots the image about its center, then orienting the image in TWOR_LANDSCAPE has the effect of rotating the original image 90 degrees to the "left". TWOR_PORTRAIT mode does not rotate the image. The image may be oriented along any of the four axes located 90 degrees from the unrotated image.

Data type:

Integer

Default value:

TWOR_PORTRAIT(0)

Allowed values:

TWOR_ROT0(0), TWOR_ROT90(1), TWOR_ROT180(2), TWOR_ROT270(3), TWOR_PORTRAIT(equals TWOR_ROT0), TWOR_LANDSCAPE(equals TWOR_ROT270)

CapType for GET:

TW_ENUMERATION, TW_ONEVALUE

CapType for SET:

TW_ENUMERATION, TW_ONEVALUE

See also:

ICAP_ROTATION


ICAP_OVERSCAN

Description: | Overscan is used to scan outside of the boundaries described by ICAP_FRAMES, and is used to help acquire image data that may be lost because of skewing. This is primarily of use for transport scanners which rely on edge detection to begin scanning. If overscan is supported, then the device is capable of scanning in the inter-document gap to get the skewed image information.
Remarks: | Use this capability, if available, to help software processing images for deskew and border removal.
Data type: | Integer
Default value: | TWOV_NONE(0)
Allowed values: | TWOV_NONE(0), TWOV_AUTO(1), TWOV_TOPBOTTOM(2), TWOV_LEFTRIGHT(3), TWOV_ALL(4)
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE
CapType for SET: | TW_ENUMERATION, TW_ONEVALUE
See also: |


ICAP_PHYSICALHEIGHT

Description: | The maximum physical height (Y-axis) the Source can acquire (measured in units of ICAP_UNITS).
Remarks: | None.
Data type: | Single(float)
Default value: | No default
Allowed values: | 0 to 65535 in ICAP_UNITS
CapType for GET: | TW_ONEVALUE
CapType for SET: | Not allowed
See also: | CAP_FEEDERENABLED, ICAP_UNITS


ICAP_PHYSICALWIDTH

Description: | The maximum physical width (X-axis) the Source can acquire (measured in units of ICAP_UNITS).
Remarks: | None
Data type: | Single(float)
Default value: | No default
Allowed values: | 0 to 65535 in ICAP_UNITS
CapType for GET: | TW_ONEVALUE
CapType for SET: | Not allowed
See also: | CAP_FEEDERENABLED, ICAP_UNITS


ICAP_PIXELFLAVOR

Description: | Sense of the pixel whose numeric value is zero (minimum data value).
Remarks: | Sources may prefer a different value depending on ICAP_PIXELTYPE. Set ICAP_PIXELTYPE and do a CapGetDefault() to determine the Source's preferences.
Data type: | Integer
Default value: | TWPF_CHOCOLATE(0)
Allowed values: | TWPF_CHOCOLATE(0), TWPF_VANILLA(1)
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: | ICAP_PIXELTYPE


ICAP_PIXELTYPE

Description:

The type of pixel data that a Source is capable of acquiring (for example, black and white, gray, RGB, etc.).

Remarks:

CapGet() returns a list of all pixel types available from the Source.

CapSet() on a TW_ENUMERATION structure requests that the Source restrict the available pixel types to the enumerated list.

CapSet() on a TW_ONEVALUE container specifies the only pixel type the application can accept.

Data type:

Integer

Default value:

No default

Allowed values:

TWPT_BW(0), TWPT_GRAY(1), TWPT_RGB(2), TWPT_PALETTE(3), TWPT_CMY(4), TWPT_CMYK(5), TWPT_YUV(6), TWPT_YUVK(7), TWPT_CIEXYZ(8)

CapType for GET:

TW_ENUMERATION, TW_ONEVALUE

CapType for SET:

TW_ENUMERATION, TW_ONEVALUE

See also:

ICAP_BITDEPTH, ICAP_BITDEPTHREDUCTION


ICAP_PLANARCHUNKY

Description: | Allows the application and Source to identify which color data formats are available. There are two options, "planar" and "chunky".
Remarks: | For example, planar RGB data is transferred with the entire red plane of data first, followed by the entire green plane, followed by the entire blue plane (typical for three-pass scanners). "Chunky" mode repetitively interlaces a pixel from each plane until all the data is transferred (R-G-B-R-G-B…) (typical for one-pass scanners).
Data type: | Integer
Default value: | No default
Allowed values: | TWPC_CHUNKY(0), TWPC_PLANAR(1)
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE
CapType for SET: | TW_ENUMERATION, TW_ONEVALUE
See also: |


ICAP_ROTATION

Description: | How the Source can/should rotate the scanned image data prior to transfer. This doesn't use ICAP_UNITS. It is always measured in degrees. Any applied value is additive with any rotation specified in ICAP_ORIENTATION.
Remarks: | None.
Data type: | Single(float)
Default value: | 0
Allowed values: | +/- 360 degrees
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE, TW_RANGE
CapType for SET: | TW_ONEVALUE
See also: | ICAP_ORIENTATION


ICAP_SHADOW

Description: | Specifies which value in an image should be interpreted as the darkest "shadow". All values "darker" than this value will be clipped to this value.
Remarks: | Whether darker values are smaller or larger can be determined by examining the Current value of ICAP_PIXELFLAVOR.
Data type: | Single(float)
Default value: | 0
Allowed values: | 0 to 255
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE, TW_RANGE
CapType for SET: | TW_ENUMERATION, TW_ONEVALUE, TW_RANGE
See also: | ICAP_PIXELFLAVOR


ICAP_SUPPORTEDSIZES

Description: | For devices that support fixed frame sizes. Defined sizes match typical page sizes. This specifies the size(s) the Source can/should use to acquire image data.
Remarks: | None.
Data type: | Integer
Default value: | No default
Allowed values: | TWSS_NONE(0), TWSS_A4LETTER(1), TWSS_B5LETTER(2), TWSS_USLETTER(3), TWSS_USLEGAL(4), TWSS_A5(5), TWSS_B4(6), TWSS_B6(7), TWSS_USLEDGER(9), TWSS_USEXECUTIVE(10), TWSS_A3(11), TWSS_B3(12), TWSS_A6(13), TWSS_C4(14), TWSS_C5(15), TWSS_C6(16), TWSS_4A0(17), TWSS_2A0(18), TWSS_A0(19), TWSS_A1(20), TWSS_A2(21), TWSS_A4(TWSS_A4LETTER), TWSS_A7(22), TWSS_A8(23), TWSS_A9(24), TWSS_A10(25), TWSS_ISOB0(26), TWSS_ISOB1(27), TWSS_ISOB2(28), TWSS_ISOB3(TWSS_B3), TWSS_ISOB4(TWSS_B4), TWSS_ISOB5(29), TWSS_ISOB6(TWSS_B6), TWSS_ISOB7(30), TWSS_ISOB8(31), TWSS_ISOB9(32), TWSS_ISOB10(33), TWSS_JISB0(34), TWSS_JISB1(35), TWSS_JISB2(36), TWSS_JISB3(37), TWSS_JISB4(38), TWSS_JISB5(TWSS_B5LETTER), TWSS_JISB6(39), TWSS_JISB7(40), TWSS_JISB8(41), TWSS_JISB9(42), TWSS_JISB10(43), TWSS_C0(44), TWSS_C1(45), TWSS_C2(46), TWSS_C3(47), TWSS_C7(48), TWSS_C8(49), TWSS_C9(50), TWSS_C10(51), TWSS_USSTATEMENT(52), TWSS_BUSINESSCARD(53)
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE
CapType for SET: | TW_ENUMERATION, TW_ONEVALUE
See also: | ICAP_FRAMES


ICAP_THRESHOLD

Description: | Specifies the dividing line between black and white. This is the value the Source will use to threshold, if needed, when ICAP_PIXELTYPE = TWPT_BW. The value is normalized so there is no unit of measure associated with this ICAP.
Remarks: | Application will typically set ICAP_BITDEPTHREDUCTION to TWBR_THRESHOLD to use this capability.
Data type: | Single(float)
Default value: | 128
Allowed values: | 0 to 255
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE, TW_RANGE
CapType for SET: | TW_ENUMERATION, TW_ONEVALUE, TW_RANGE
See also: | ICAP_BITDEPTHREDUCTION


ICAP_TILES

Description: | This is used with buffered memory transfers. If TRUE, Source can provide application with tiled image data.
Remarks: | If set to TRUE, the application expects the Source to supply tiled data for the upcoming transfer(s). This persists until the application sets it to FALSE. If the application sets it to FALSE, Source will supply strip data.
Data type: | Boolean
Default value: | No default
Allowed values: | TRUE(1) or FALSE(0)
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: |


ICAP_UNDEFINEDIMAGESIZE

Description: | If TRUE the Source will issue a MSG_XFERRDY before starting the scan. .
Remarks: | Used by the application to notify the Source that the application accepts -1 as the image width or -length. The Source may need to scan the image before initiating the transfer. This is the case if the scanned image is rotated or merged with another scanned image.
Data type: | Boolean
Default value: | FALSE
Allowed values: | TRUE(1) or FALSE(0)
CapType for GET: | TW_ONEVALUE
CapType for SET: | TW_ONEVALUE
See also: |


ICAP_UNITS

Description: | Unless a quantity is dimensionless or uses a specified unit of measure, ICAP_UNITS determines the unit of measure for all quantities.
Remarks: | Applications should be able to handle TWUN_PIXELS if they want to support data transfers from "dimensionless" devices such as digital cameras.
Data type: | Integer
Default value: | TWUN_INCHES(0)
Allowed values: | TWUN_INCHES(0), TWUN_CENTIMETERS(1), TWUN_PICAS(2), TWUN_POINTS(3), TWUN_TWIPS(4), TWUN_PIXELS(5)
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE
CapType for SET: | TW_ENUMERATION, TW_ONEVALUE
See also: | ICAP_FRAMES


ICAP_XFERMECH

Description: | Allows the application and Source to identify which transfer mechanisms they have in common.
Remarks: | None
Data type: | Integer
Default value: | TWSX_NATIVE(0)
Allowed values: | TWSX_NATIVE(0), TWSX_FILE(1), TWSX_MEMORY(2)
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE
CapType for SET: | TW_ENUMERATION, TW_ONEVALUE
See also: |


ICAP_XNATIVERESOLUTION

Description: | The native optical resolution along the X-axis of the device controlled by the Source. Most devices will respond with a single value (TW_ONEVALUE). This is NOT a list of all resolutions that can be generated by the device. Rather, this is the resolution of the device's optics. Measured in units of pixels per unit as defined by ICAP_UNITS (pixels per TWUN_PIXELS yields dimensionless data).
Remarks: | None
Data type: | Single(float)
Default value: | No default
Allowed values: | > 0
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE
CapType for SET: | Not allowed
See also: | ICAP_UNITS, ICAP_XRESOLUTION, ICAP_YNATIVERESOLUTION


ICAP_XRESOLUTION

Description: | All the X-axis resolutions the Source can provide. Measured in units of pixels per unit as defined by ICAP_UNITS (pixels per TWUN_PIXELS yields dimensionless data). That is, when the units are TWUN_PIXELS, both ICAP_XRESOLUTION and ICAP_YRESOLUTION shall report 1 pixel/pixel. Some data sources like to report the actual number of pixels that the device reports, but that response is more appropriate in ICAP_PHYSICALHEIGHT and ICAP_PHYSICALWIDTH.
Remarks: | Setting this value will restrict the various resolutions that will be available to the user during acquisition. Applications will want to ensure that the values set for this ICAP match those set for ICAP_YRESOLUTION.
Data type: | Single(float)
Default value: | No default
Allowed values: | > 0
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE, TW_RANGE
CapType for SET: | TW_ENUMERATION, TW_ONEVALUE, TW_RANGE
See also: | ICAP_UNITS, ICAP_XNATIVERESOLUTION, ICAP_YRESOLUTION


ICAP_XSCALING

Description: | All the X-axis scaling values available. A value of '1.0' is equivalent to 100% scaling. Do not use values less than or equal to zero.
Remarks: | Applications will want to ensure that the values set for this ICAP match those set for ICAP_YSCALING. There is no unit inherent with this data as it is normalized to 1.0 being "unscaled".
Data type: | Single(float)
Default value: | 1.0
Allowed values: | > 0
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE, TW_RANGE
CapType for SET: | TW_ENUMERATION, TW_ONEVALUE, TW_RANGE
See also: | ICAP_YSCALING


ICAP_YNATIVERESOLUTION

Description: | The native optical resolution along the Y-axis of the device controlled by the Source. Measured in units of pixels per unit as defined by ICAP_UNITS (pixels per TWUN_PIXELS yields dimensionless data).
Remarks: | Most devices will respond with a single value (TW_ONEVALUE). This is NOT a list of all resolutions that can be generated by the device. Rather, this is the resolution of the device's optics
Data type: | Single(float)
Default value: | No default
Allowed values: | >0
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE
CapType for SET: | TW_ENUMERATION, TW_ONEVALUE
See also: | ICAP_UNITS, ICAP_XNATIVERESOLUTION, ICAP_YRESOLUTION


ICAP_YRESOLUTION

Description: | All the Y-axis resolutions the Source can provide. Measured in units of pixels per unit as defined by ICAP_UNITS (pixels per TWUN_PIXELS yields dimensionless data). That is, when the units are TWUN_PIXELS, both ICAP_XRESOLUTION and ICAP_YRESOLUTION shall report 1 pixel/pixel. Some data sources like to report the actual number of pixels that the device reports, but that response is more appropriate in ICAP_PHYSICALHEIGHT and ICAP_PHYSICALWIDTH.
Remarks: | Setting this value will restrict the various resolutions that will be available to the user during acquisition. Applications will want to ensure that the values set for this ICAP match those set for ICAP_XRESOLUTION.
Data type: | Single(float)
Default value: | No default
Allowed values: | > 0
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE, TW_RANGE
CapType for SET: | TW_ENUMERATION, TW_ONEVALUE, TW_RANGE
See also: | ICAP_UNITS, ICAP_XRESOLUTION, ICAP_YNATIVERESOLUTION


ICAP_YSCALING

Description: | All the Y-axis scaling values available. A value of '1.0' is equivalent to 100% scaling. Do not use values less than or equal to zero. There is no unit inherent with this data as it is normalized to 1.0 being "unscaled".
Remarks: | Applications will want to ensure that the values set for this ICAP match those set for ICAP_XSCALING.
Data type: | Single(float)
Default value: | 1.0
Allowed values: | > 0
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE, TW_RANGE
CapType for SET: | TW_ENUMERATION, TW_ONEVALUE, TW_RANGE
See also: | ICAP_XSCALING


ICAP_ZOOMFACTOR

Description: | When used with CapGet(), returns all camera supported lens zooming range.
Remarks: | Use this capability with CapSet() to select one of the lens zooming value that the Source supports.
Data type: | Integer
Default value: | 0
Allowed values: | Device dependent
CapType for GET: | TW_ENUMERATION, TW_ONEVALUE, TW_RANGE
CapType for SET: | TW_ONEVALUE
See also: |


Appdendix

There are two topics in this sub heading:

Error List

Constants

If you do NOT want to read this documentation or spend any time in TWAIN, please click here.


Constants

Pixel Type

TWPT_BW | 0
TWPT_GRAY | 1
TWPT_RGB | 2

Capability

CAP_XFERCOUNT | 0x0001
ICAP_COMPRESSION | 0x0100
ICAP_PIXELTYPE | 0x0101
ICAP_UNITS | 0x0102
ICAP_XFERMECH | 0x0103
CAP_AUTHOR | 0x1000
CAP_CAPTION | 0x1001
CAP_FEEDERENABLED | 0x1002
CAP_FEEDERLOADED | 0x1003
CAP_TIMEDATE | 0x1004
CAP_SUPPORTEDCAPS | 0x1005
CAP_EXTENDEDCAPS | 0x1006
CAP_AUTOFEED | 0x1007
CAP_CLEARPAGE | 0x1008
CAP_FEEDPAGE | 0x1009
CAP_REWINDPAGE | 0x100a
CAP_INDICATORS | 0x100b
CAP_SUPPORTEDCAPSEXT | 0x100c
CAP_PAPERDETECTABLE | 0x100d
CAP_UICONTROLLABLE | 0x100e
CAP_DEVICEONLINE | 0x100f
CAP_AUTOSCAN | 0x1010
CAP_THUMBNAILSENABLED | 0x1011
CAP_DUPLEX | 0x1012
CAP_DUPLEXENABLED | 0x1013
CAP_ENDORSER | 0x1016
CAP_ALARMS | 0x1018
CAP_ALARMVOLUME | 0x1019
CAP_AUTOMATICCAPTURE | 0x101a
CAP_TIMEBEFOREFIRSTCAPTURE | 0x101b
CAP_TIMEBETWEENCAPTURES | 0x101c
CAP_CLEARBUFFERS | 0x101d
CAP_MAXBATCHBUFFERS | 0x101e
CAP_DEVICETIMEDATE | 0x101f
CAP_POWERSUPPLY | 0x1020
CAP_CAMERAPREVIEWUI | 0x1021
CAP_PAGEMULTIPLEACQUIRE | 0x1023
CAP_SERIALNUMBER | 0x1024
CAP_FILESYSTEM | 0x1025
CAP_PRINTER | 0x1026
CAP_PRINTERENABLED | 0x1027
CAP_PRINTERINDEX | 0x1028
CAP_PRINTERMODE | 0x1029
CAP_PRINTERSTRING | 0x102a
CAP_PRINTERSUFFIX | 0x102b
CAP_LANGUAGE | 0x102c
CAP_FEEDERALIGNMENT | 0x102d
CAP_FEEDERORDER | 0x102e
CAP_PAPERBINDING | 0x102f
CAP_REACQUIREALLOWED | 0x1030
CAP_PASSTHRU | 0x1031
CAP_BATTERYMINUTES | 0x1032
CAP_BATTERYPERCENTAGE | 0x1033
CAP_POWERDOWNTIME | 0x1034
ICAP_AUTOBRIGHT | 0x1100
ICAP_BRIGHTNESS | 0x1101
ICAP_CONTRAST | 0x1103
ICAP_CUSTHALFTONE | 0x1104
ICAP_EXPOSURETIME | 0x1105
ICAP_FILTER | 0x1106
ICAP_FLASHUSED | 0x1107
ICAP_GAMMA | 0x1108
ICAP_HALFTONES | 0x1109
ICAP_HIGHLIGHT | 0x110a
ICAP_IMAGEFILEFORMAT | 0x110c
ICAP_LAMPSTATE | 0x110d
ICAP_LIGHTSOURCE | 0x110e
ICAP_ORIENTATION | 0x1110
ICAP_PHYSICALWIDTH | 0x1111
ICAP_PHYSICALHEIGHT | 0x1112
ICAP_SHADOW | 0x1113
ICAP_FRAMES | 0x1114
ICAP_XNATIVERESOLUTION | 0x1116
ICAP_YNATIVERESOLUTION | 0x1117
ICAP_XRESOLUTION | 0x1118
ICAP_YRESOLUTION | 0x1119
ICAP_MAXFRAMES | 0x111a
ICAP_TILES | 0x111b
ICAP_BITORDER | 0x111c
ICAP_CCITTKFACTOR | 0x111d
ICAP_LIGHTPATH | 0x111e
ICAP_PIXELFLAVOR | 0x111f
ICAP_PLANARCHUNKY | 0x1120
ICAP_ROTATION | 0x1121
ICAP_SUPPORTEDSIZES | 0x1122
ICAP_THRESHOLD | 0x1123
ICAP_XSCALING | 0x1124
ICAP_YSCALING | 0x1125
ICAP_BITORDERCODES | 0x1126
ICAP_PIXELFLAVORCODES | 0x1127
ICAP_JPEGPIXELTYPE | 0x1128
ICAP_TIMEFILL | 0x112a
ICAP_BITDEPTH | 0x112b
ICAP_BITDEPTHREDUCTION | 0x112c
ICAP_UNDEFINEDIMAGESIZE | 0x112d
ICAP_MINIMUMHEIGHT | 0x1130
ICAP_MINIMUMWIDTH | 0x1131
ICAP_AUTODISCARDBLANKPAGES | 0x1134
ICAP_FLIPROTATION | 0x1136
ICAP_ZOOMFACTOR | 0x113e
ICAP_PATCHCODEDETECTIONENABLED | 0x113f
ICAP_FLASHUSED2 | 0x1146
ICAP_IMAGEFILTER | 0x1147
ICAP_NOISEFILTER | 0x1148
ICAP_OVERSCAN | 0x1149
ICAP_AUTOMATICBORDERDETECTION | 0x1150
ICAP_AUTOMATICDESKEW | 0x1151
ICAP_AUTOMATICROTATE | 0x1152

File Format

TWFF_TIFF | 0
TWFF_PICT | 1
TWFF_BMP | 2
TWFF_XBM | 3
TWFF_JFIF | 4
TWFF_FPX | 5
TWFF_TIFFMULTI | 6
TWFF_PNG | 7
TWFF_SPIFF | 8
TWFF_EXIF | 9

Interpolation Method

NearestNeighbor | 1
Bilinear | 2
Bicubic | 3

Messasge Type

TWQC_GET | 0x0001
TWQC_SET | 0x0002
TWQC_GETDEFAULT | 0x0004
TWQC_GETCURRENT | 0x0008
TWQC_RESET | 0x0010

Capability Container Type

TWON_ARRAY | 3
TWON_ENUMERATION | 4
TWON_ONEVALUE | 5
TWON_RANGE | 6

Transfer Mode

TWSX_NATIVE | 0
TWSX_FILE | 1
TWSX_MEMORY | 2

Unit

TWUN_INCHES | 0
TWUN_CENTIMETERS | 1
TWUN_PICAS | 2
TWUN_POINTS | 3
TWUN_TWIPS | 4
TWUN_PIXELS | 5

BORDER_STYLE

None | 0
SingleFlat | 1
Single3D | 2

TIFFCompressionType

TIFF_AUTO | 0
TIFF_NONE | 1
TIFF_RLE | 2
TIFF_FAX3 | 3
TIFF_T4 | 3
TIFF_FAX4 | 4
TIFF_T6 | 4
TIFF_LZW | 5
TIFF_PACKBITS | 32773


Error List

The followings are the errors defined in Dynamic Web TWAIN:

Value | Description
0 | Successful.
-1001 | General failure.
-1002 | Not enough memory to perform operation.
-1003 | Source Manager unable to find the specified Source.
-1004 | Source is connected to maximum supported number of applications.
-1005 | Source or Source Manager reported an error to the user and handled the error.
-1006 | Capability not supported by Source or operation is not supported on capability, or capability had dependencies on other capabilities and cannot be operated upon at this time.
-1009 | Unrecognized operation triplet.
-1010 | Data parameter out of supported range.
-1011 | Operation out of expected sequence.
-1012 | Unknown destination in DSM_Entry.
-1013 | Capability not supported by source.
-1014 | Operation not supported by capability.
-1015 | Capability has dependency on other capability and cannot be operated upon at this time.
-1016 | File System operation is denied (file is protected).
-1017 | Operation failed because file already exists.
-1018 | File not found.
-1019 | Operation failed because directory is not empty.
-1020 | The feeder is jammed.
-1021 | The feeder detected multiple pages.
-1022 | Error writing file.
-1023 | The device went offline prior to or during this operation.
-1030 | Can not open Source Manager. TWain_32.dll is missing or is in use by another application.
-1031 | Sequence error. The operation can not be performed upon the current Source Manager or Source state.
-1032 | User cancelled the operation.
-1033 | Invalid index.
-1034 | Invalid value.
-1035 | There is no image.
-1036 | Error reading file
-1070 | BMP file or format error
-1071 | JPEG file or format error.
-1073 | Only 24-bit true color and 8-bit gray-scaled images are supported for JPEG compression.
-1080 | General TIFF error.
-1081 | TIFF format error or not supported.
-1090 | BMP format error or not supported.
-1100 | PNG format error or not supported.
-1110 | Unrecognized file extension.
-2000 | Can not initiate the internet session.
-2001 | HTTP request error.
-2002 | HTTP server error.
-2003 | HTTP process error.
-2004 | FTP download file is too large.
<= -3000 | See ErrorString property for details.

See Also

ErrorCode property, ErrorString property


Welcome

Thank you very much for choosing Dynamic Web TWAIN Plug-in 5.

If you do NOT want to read this documentation or spend any time in TWAIN, please click here.

The topics included in this Getting Started are:

What is Dynamic Web TWAIN Plug-in
How to use Dynamic Web TWAIN Plug-in
License Agreement
Other Documentation

2007, Dynamsoft Corporation,
All the trademarks belong to their respective owners and are hereby acknowledged.


What is Dynamic Web TWAIN Plug-in

What is Plug-in

A plug-in is a dynamic code module that is native to the specific platform on which the browser is running. It is a code library, rather than an application or an applet, and runs only from the browser. Plug-ins offer a rich variety of features that can increase the flexibility of Gecko-based browsers.

Plug-ins are associated with one or more MIME types. When the browser starts, it enumerates the available plug-ins (this step varies according to platform), reads resources from each plug-in file to determine the MIME types for that plug-in, and registers each plug-in library for its MIME types.

What is Dynamic Web TWAIN Plug-in

Dynamic Web TWAIN Plug-in is a windowed plug-in which enables you to acquire images from any TWAIN compatible devices in Gecko-based browsers such as Netscape and Firefox. With the carefully designed interface, and the built-in wizard mode, Dynamic Web TWAIN Plug-in is very easy to use. You can typically do your TWAIN job in several lines of code. At the same time, Dynamic Web TWAIN Plug-in is very powerful. It is compatible with TWAIN specification V1.9. It has built-in TIFF, PDF, JPEG and PNG encoder and decoder. It supports all three image transfer modes and many other features.

With Dynamic Web TWAIN Plug-in you can control any scanner, digital camera or capture card if it has a TWAIN driver. High-level acquisition support is provided for ease of use, and low-level functionality is provided for flexibility and control in even the most demanding applications.


How to use Dynamic Web TWAIN Plug-in

When Dynamic Web TWAIN Plug-in is not registered in the HTML, Gecko-based browsers invoke the default plug-in to help users find and install the right plug-in for that MIME type. The blue puzzle piece that appears in the HTML page’s plug-in window when the default plug-in loads is meant to signify that the browser is missing a piece that it needs to display or play the requested media.

How the plug-in HTML tag was coded determines what action is taken when the user clicks the plug-in piece. If the browser cannot handle the given MIME type, then the default plug-in checks to see if there is a plug-in referenced in the EMBED tag that defines the media. If there is, then the default plug-in prompts the user to download that plug-in from the specified location.

You can use the HTML EMBED as the following sample to invoke Dynamic Web Twain Plug-in.

<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"

OnPreTransfer="OnPreTransferCallback()"

OnPostTransfer="OnPostTransferCallback()"

OnPreAllTransfers="OnPreAllTransfersCallback()"

OnPostAllTransfers="OnPostAllTransfersCallback()"

OnTransferCancelled="OnTransferCancelledCallback()"

OnTransferError="OnTransferErrorCallback()"

OnMouseClick="OnMouseClickCallback"

OnMouseMove="OnMouseMoveCallback"

WIDTH="100"

HEIGHT="100"

PLUGINSPAGE="http://www.dynamsoft.com/DynamicWebTwain.xpi">

</EMBED>

<input type="button" onclick="AcquireImage()" value="AcquireImage" >

<script>

function OnPreTransferCallback()

{

// Add your code here

}

function OnPostTransferCallback()

{

// Add your code here

}

function OnPreAllTransfersCallback()

{

// Add your code here

}

function OnPostAllTransfersCallback()

{

// Add your code here

}

function OnTransferCancelledCallback()

{

// Add your code here

}

function OnTransferErrorCallback()

{

// Add your code here

}

function OnMouseClickCallback(sImageIndex)

{

// Add your code here

}

function OnMouseMoveCallback(sImageIndex)

{

// Add your code here

}

function AcquireImage()

{// scan image

var plugin = document.embeds[0];

plugin.AcquireImage();

}

</script>

</body>

</html>

Note:

  1. The PLUGINSPAGE is the URL of DynamicWebTwain.xpi for download.

  2. You must include the TYPE attribute in an EMBED tag. If you do not, then there is no way of determining the media type, and so no plug-in loads. Use TYPE to specify MIME type necessary to display the plug-in.

  3. The MIME type that is specified by TYPE attribute must be added to the MIME types list on the Web Server where DynamicWebTwain.xpi can be downloaded. About how to add a MIME type to MIME types list on IIS, you can refer to Microsoft IIS Deployment Guide. If you are using Apache, please add the following line to your httpd.conf file.
    "AddType application/x-xpinstall .xpi"

  4. After DynamicWebTWAIN.xpi is downloaded, you need to open it in the browser to install the plug-in.

  5. About OnPreTransfer, OnPostTransfer, OnPreAllTransfers, OnPostAllTransfers, OnTransferCancelled and OnTransferError events in the above sample code, please refer to 'Dynamic Web TWAIN ActiveX' section of this documentation .


License Agreement

IMPORTANT: PLEASE READ CAREFULLY.

THE USE OF THIS SOFTWARE IS SUBJECT TO THE TERMS OF THE LICENSE AGREEMENT PRINTED BELOW. IF YOU DO NOT AGREE WITH ANY OF THE TERMS, THEN YOU SHOULD NOT USE THE SOFTWARE OR ANY PART OF THE SOFTWARE IN ANY WAY. BY USING THIS PRODUCT, YOU AGREE TO BE BOUND BY ALL THE TERMS AND CONDITIONS OF THIS LICENSE AGREEMENT.

THE AGREEMENT

This document is a legal agreement between Dynamsoft Corporation., Canada, hereafter referred to as "Dynamsoft" and the user of the software herein referred to as "You".

DEFINITIONS

"SOFTWARE" means the software known as "Dynamic Web TWAIN Plug-In Control" and all its components, parts and documentation, which have been developed by Dynamsoft.

GRANT OF LIMITED LICENSE

I. EVALUATION LICENSE

Dynamsoft grants you a limited, non-exclusive, non-transferable, personal license to use the SOFTWARE for evaluation purposes only for 30 days. The license does not permit the development and distribution of any applications using the SOFTWARE. You may not distribute any part of the SOFTWARE.

II. DEVELOPER LICENSE
With developer license, you may not deploy the SOFTWARE on web server, including internet and intranet server.

Dynamsoft grants you a limited, not-exclusive, non-transferable license to user the SOFTWARE and the accompanying materials for the purpose of development.

With one Developer License, only one developer can use the SOFTWARE for development purpose.

III. WEB SERVER LICENSE

You may not use the Web Server License for development purpose.

With one Web Server License, you can deploy the SOFTWARE on only one web server.

RESTRICTIONS

You must NOT distribute the DynamicWebTwainPlugIn5.lic file under any circumstances.

Your product is targeted to end users. The end user application must not be another development tool designed to be used for creating other end user applications using the SOFTWARE.

A user of any end user applications may not further use parts of the SOFTWARE for software development, copying or distribution. You must enforce this in a separate agreement with the user of any end user applications.

For Evaluation License and Developer License, you may use only one copy of the SOFTWARE at any time for each license. The SOFTWARE is "in-use" on a computer when it is loaded into temporary memory (i.e. RAM) or installed into the storage device of that computer.

You may make a single copy of the SOFTWARE for backup purposes only.

You are not allowed to expose directly or indirectly the properties and methods of the SOFTWARE.

All rights reserved. You may not use, copy, modify, reverse engineer, decompile, disassemble, sell, transfer, hire, lend or otherwise distribute the SOFTWARE or any accompanying materials in whole or in part, except as expressly provided for in this agreement.

OWNERSHIP

Dynamsoft shall remain the owner of the SOFTWARE.

This license does not confer any ownership rights to the licensee.

WARRANTIES AND DISCLAIMERS

THIS SOFTWARE AND THE ACCOMPANYING FILES ARE SOLD "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ANY USE BY YOU OF THE SOFTWARE IS AT YOUR OWN RISK.

NO LIABILITY FOR CONSEQUENTIAL DAMAGES. UNDER NO CIRCUMSTANCE SHALL DYNAMSOFT BE RELIABLE FOR ANY DAMAGES WHATSOEVER ARISING FROM THE USING OR INABILITY TO USE DYNAMSOFT PRODUCT.

APPLICABLE LAW

This agreement shall be governed by the laws of Canada.


Other Documentation

Dynamic Web TWAIN Plug-in and Dynamic Web TWAIN ActiveX have the same features.

For other documentation of Dynamic Web TWAIN Plug-in, you can refer to Dynamic Web TWAIN ActiveX section.


CAP_BATTERYPERCENTAGE

Description: | When used with CapGet(), return the percentage of battery power level on camera. If -1 is returned, it indicates that the battery is not present.
Remarks: | It is recommended to use CAP_POWERSUPPLY to identify the power source first. -2 indicates that the available power is infinite. -1 indicates that the device cannot report the remaining battery power. 0 to 100 indicates the percentage of battery life remaining.
Data type: | Integer
Default value: | No default
Allowed values: | -2, -1, 0 to 100.
CapType for GET: | TW_ONEVALUE
CapType for SET: | Not allowed
See also: | CAP_POWERSUPPLY, CAP_BATTERYMINUTES


Method LoadDibFromClipboard

LoadDibFromClipboard Method

Description

Loads a DIB format image from Clipboard into the Dynamic Web TWAIN.

Syntax

Boolean ObjectName. LoadDibFromClipboard()

Parameters

None.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

The loaded image will be displayed in the Dynamic Web TWAIN.

See Also

LoadImage(),
CopyToClipboard(),
CutToClipboard(),
LoadImageEx()


Dynamic Web TWAIN Help

Dynamic Web TWAIN ActiveX Help

1. Getting Started

2. Programmer Guide

3. Methods

4. Properties

5. Events

6. Capabilities

7. Appendix

Detailed Index

1. Getting Started

  • What is Dynamic Web TWAIN
  • TWAIN Overview
  • TWAIN State Transition
  • Benefits
  • Features
  • Edition Comparison
  • What's New
  • License Agreement
  • FAQ
  • Virtual Developer Service
  • Getting Supported
  • Distributing Dynamic Web TWAIN

2. Programmer Guide

  • The "Hello World" Sample
  • The Data Type Mapping between COM Object, VB, C/C++ and Delphi
  • Deploying Dynamic Web TWAIN on Web Server
  • Using Dynamic Web TWAIN in Different Development Environments
    • Using Dynamic Web TWAIN in Microsoft Visual Basic 6
    • Using Dynamic Web TWAIN in Microsoft Visual C++
      • Using Dynamic Web TWAIN in Microsoft Visual C++ Dialog Based Applications
      • Using Dynamic Web TWAIN in Microsoft Visual C++ Non-Dialog Based Applications
    • Using Dynamic Web TWAIN in Borland Delphi
    • Using Dynamic Web TWAIN in Microsoft Visual Studio .NET
  • Capability Negotiation
    • Why Capability Negotiation
    • What You can Do with Capability Negotiation
    • Capability Container Types
    • Capability Negotiation Operation Types
    • How to Negotiate Capability with Different Capability Container Types
    • How to Negotiate ICAP_FRAMES

3. Methods

  • AcquireImage
  • CancelAllPendingTransfers
  • CapGet
  • CapGetCurrent
  • CapGetDefault
  • CapGetFrameBottom
  • CapGetFrameLeft
  • CapGetFrameRight
  • CapGetFrameTop
  • CapIfSupported
  • CapReset
  • CapSet
  • CapSetFrame
  • ChangeImageSize
  • ClearAllHTTPFormFiled
  • CloseSource
  • CloseSourceManager
  • CopyToClipboard
  • Crop
  • CropToClipboard
  • CutToClipboard
  • DisableSource
  • EnableSource
  • FeedPage
  • FTPDownload
  • FTPDownloadEx
  • FTPUpload
  • FTPUploadEx
  • FTPUploadAllAsMultiPageTIFF
  • FTPUploadAllAsPDF
  • GetDefaultImageLayout
  • GetImageLayout
  • GetImageSize
  • GetViewMode
  • HTTPDownload
  • HTTPDownloadEx
  • HTTPUploadThroughPost
  • HTTPUploadThroughPostEx
  • HTTPUploadAllThroughPostAsMultiPageTIFF
  • HTTPUploadAllThroughPostAsPDF
  • HTTPUploadThroughPut
  • HTTPUploadThroughPutEx
  • HTTPUploadAllThroughPutAsMultiPageTIFF
  • HTTPUploadAllThroughPutAsPDF
  • LoadDibFromClipboard
  • LoadImage
  • LoadImageEx
  • Mirror
  • OpenSource
  • OpenSourceManager
  • RemoveAllImages
  • RemoveImage
  • ResetImageLayout
  • RewindPage
  • RotateLeft
  • RotateRight
  • SaveAllAsMultiPageTIFF
  • SaveAllAsPDF
  • SaveAsBMP
  • SaveAsJPEG
  • SaveAsPDF
  • SaveAsPNG
  • SaveAsTIFF
  • SelectSource
  • SelectSourceByIndex
  • SetFileXferInfo
  • SetHTTPFormField
  • SetImageLayout
  • SetViewMode
  • ShowImageEditor

4. Properties

  • BitDepth
  • BorderStyle
  • Brightness
  • Capability
  • CapCurrentIndex
  • CapCurrentValue
  • CapDefaultIndex
  • CapDefaultValue
  • CapDescription
  • CapItems
  • CapItemsString
  • CapMaxValue
  • CapMinValue
  • CapNumItems
  • CapStepSize
  • CapType
  • CapValue
  • CapValueString
  • Contrast
  • CurrentImageIndexInBuffer
  • CurrentSourceName
  • DataSourceStatus
  • DefaultSourceName
  • Duplex
  • ErrorCode
  • ErrorString
  • FTPPassword
  • FTPPort
  • FTPUserName
  • hDIB
  • HowManyImagesInBuffer
  • HTTPPassword
  • HTTPPort
  • HTTPPostResponseString
  • HTTPUserName
  • MouseShape
  • IfAutoBright
  • IfAutoFeed
  • IfAutoScan
  • IfDeviceOnline
  • IfDisableSourceAfterAcquire
  • IfDuplexEnabled
  • IfFeederEnabled
  • IfFeederLoaded
  • IfFitWindow
  • IfModalUI
  • IfPaperDetectable
  • IfShowCancelDialogWhenImageTransfer
  • IfShowUI
  • IfShowIndicator
  • IfSSL
  • IfThrowException
  • IfTiffMultiPage
  • IfUIControllable
  • ImageBitsPerPixel
  • ImageEditorIfEnableEnumerator
  • ImageEditorIfReadonly
  • ImageEditorWindowTitle
  • ImageLayoutDocumentNumber
  • ImageLayoutFrameBottom
  • ImageLayoutFrameLeft
  • ImageLayoutFrameNumber
  • ImageLayoutFrameRight
  • ImageLayoutFrameTop
  • ImageLayoutPageNumber
  • ImageLength
  • ImageMargin
  • ImagePixelType
  • ImageWidth
  • ImageXResolution
  • ImageYResolution
  • JPEGQuality
  • Manufacturer
  • MaxImagesInBuffer
  • PageSize
  • PDFAuthor
  • PDFCompressionType
  • PDFCreationDate
  • PDFCreator
  • PDFKeywords
  • PDFModifiedDate
  • PDFProducer
  • PDFSubject
  • PDFTitle
  • PendingXfers
  • Picture
  • PixelFlavor
  • PixelType
  • ProductFamily
  • ProductName
  • ProxyServer
  • Resolution
  • SourceCount
  • SourceNameItems
  • TIFFCompressionType
  • TransferMode
  • Unit
  • VersionInfo
  • XferCount

5. Events

  • OnMouseClick
  • OnMouseMove
  • OnPreAllTransfers
  • OnPreTransfer
  • OnPostTransfer
  • OnPostAllTransfers
  • OnTransferCancelled
  • OnTransferError
  • OnInternetTransferPercentage

6. Capabilities

  • CAP_AUTHOR
  • CAP_AUTOFEED
  • CAP_AUTOMATICCAPTURE
  • CAP_AUTOSCAN
  • CAP_BATTERYMINUTES
  • CAP_BATTERYPERCENTAGE
  • CAP_CAMERAPREVIEWUI
  • CAP_CAPTION
  • CAP_CLEARBUFFERS
  • CAP_CLEARPAGE
  • CAP_DEVICEONLINE
  • CAP_DEVICETIMEDATE
  • CAP_DUPLEX
  • CAP_DUPLEXENABLED
  • CAP_ENABLEDSUIONLY
  • CAP_ENDORSER
  • CAP_EXTENDEDCAPS
  • CAP_FEEDERALIGNMENT
  • CAP_FEEDERENABLED
  • CAP_FEEDERLOADED
  • CAP_FEEDERORDER
  • CAP_FEEDPAGE
  • CAP_INDICATORS
  • CAP_LANGUAGE
  • CAP_MAXBATCHBUFFERS
  • CAP_PAPERDETECTABLE
  • CAP_POWERDOWNTIME
  • CAP_POWERSUPPLY
  • CAP_PRINTER
  • CAP_PRINTERENABLED
  • CAP_PRINTERINDEX
  • CAP_PRINTERMODE
  • CAP_PRINTERSTRING
  • CAP_PRINTERSUFFIX
  • CAP_REACQUIREALLOWED
  • CAP_REWINDPAGE
  • CAP_SERIALNUMBER
  • CAP_SUPPORTEDCAPS
  • CAP_TIMEBEFOREFIRSTCAPTURE
  • CAP_TIMEBETWEENCAPTURES
  • CAP_TIMEDATE
  • CAP_UICONTROLLABLE
  • CAP_XFERCOUNT
  • ICAP_AUTOBRIGHT
  • ICAP_AUTODISCARDBLANKPAGES
  • ICAP_AUTOMATICDESKEW
  • ICAP_AUTOMATICBORDERDETECTION
  • ICAP_AUTOMATICROTATE
  • ICAP_BITDEPTH
  • ICAP_BITDEPTHREDUCTION
  • ICAP_BITORDER
  • ICAP_BRIGHTNESS
  • ICAP_CONTRAST
  • ICAP_CUSTHALFTONE
  • ICAP_EXPOSURETIME
  • ICAP_FILTER
  • ICAP_FLASHUSED
  • ICAP_FLASHUSED2
  • ICAP_FLIPROTATION
  • ICAP_FRAMES
  • ICAP_GAMMA
  • ICAP_HALFTONES
  • ICAP_HIGHLIGHT
  • ICAP_IMAGEFILEFORMAT
  • ICAP_IMAGEFILTER
  • ICAP_LAMPSTATE
  • ICAP_LIGHTPATH
  • ICAP_LIGHTSOURCE
  • ICAP_MAXFRAMES
  • ICAP_MINIMUMHEIGHT
  • ICAP_MINIMUMWIDTH
  • ICAP_NOISEFILTER
  • ICAP_ORIENTATION
  • ICAP_OVERSCAN
  • ICAP_PHYSICALHEIGHT
  • ICAP_PHYSICALWIDTH
  • ICAP_PIXELFLAVOR
  • ICAP_PIXELTYPE
  • ICAP_PLANARCHUNKY
  • ICAP_ROTATION
  • ICAP_SHADOW
  • ICAP_SUPPORTEDSIZES
  • ICAP_THRESHOLD
  • ICAP_TILES
  • ICAP_UNDEFINEDIMAGESIZE
  • ICAP_UNITS
  • ICAP_XFERMECH
  • ICAP_XNATIVERESOLUTION
  • ICAP_XRESOLUTION
  • ICAP_XSCALING
  • ICAP_YNATIVERESOLUTION
  • ICAP_YRESOLUTION
  • ICAP_YSCALING
  • ICAP_ZOOMFACTOR

7. Appendix

  • Error List
  • Constants

GO TOP

GO TOP

GO TOP

GO TOP

GO TOP

GO TOP

GO TOP

Dynamic Web TWAIN Plug-in Help

  • What is Dynamic Web TWAIN Plug-in
  • How to use Dynamic Web TWAIN Plug-in
  • License Agreement
  • Other Documentation


Method ShowImageEditor

ShowImageEditor Method

Description

Shows the GUI of Image Editor.

Syntax

Boolean ObjectName. ShowImageEditor()

Parameters

None.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

None.

See Also

RotateLeft(),
RotateRight(),
Flip(), Mirror(),
Crop(),
CropToClipboard(), GetImageSize(),
ChangeImageSize(),
ImageEditorWindowTitle property,
ImageEditorIfReadonly property,
ImageEditorIfEnableEnumerator
property

Samples

VB Sample:
Private Sub Scan_Click()
    Twain.AcquireImage
End Sub

Private Sub Edit_Click()
    Twain.ShowImageEditor
End Sub


Method Description

Method

Description

B

Syntax

B

Parameters

None.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure. When FALSE is returned, check ErrorCode property and ErrorString property for error information.

Remarks

R

See also

S

Sample

S


Method Description

Method

Description

Syntax

Parameters

Return value

Remarks

See also

Sample


Property IfSSL

IfSSL Property

Description

Sets or returns whether SSL is used when uploading or downloading images.

Data type

Boolean

Syntax

ObjectName. IfSSL

Remarks

The default value is FALSE. This property is used with HTTPPort property.

IfSSL | HTTPPort | Actions
TRUE | The value of HTTPPort property must be the port number of secure port | The images will be uploaded or downloaded via SSL.
FALSE | The value of HTTPPort property must be the port number of non-secure port | The images will be uploaded or downloaded via non-SSL.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown. Check ErrorCode property and ErrorString property for error information.

See also

HTTPPort
property,
HTTPDownload(),
HTTPUploadThroughPost(),
HTTPUploadThroughPut(),

HTTPUploadAllThroughPostAsMultiPageTIFF(),

HTTPUploadAllThroughPutAsMultiPageTIFF()

Samples

The following sample shows how to use IfSSL property.

JavaScript Sample:
<SCRIPT LANGUAGE="javascript">

function btnUpload_onclick()
{
frmScan.DynamicWebTwain1.HTTPPort = 80;
frmScan.DynamicWebTwain1.IfSSL = false; // if 80 is the port number of non-secure port

/*
frmScan.DynamicWebTwain1.HTTPPort = 443;
frmScan.DynamicWebTwain1.IfSSL = true; // if 443 is the port number of secure port
*/

frmScan.DynamicWebTwain1.HTTPUploadThroughPost("127.0.0.1", 0, "/SaveToFile.php", "imageData.jpg");

if (frmScan.DynamicWebTwain1.ErrorCode != 0)
alert(frmScan.DynamicWebTwain1.ErrorString);
else //succeded
alert("Successful");
}
</SCRIPT>