The following properties are typically set before image acquisition begins: |
| Height | | Read/Write Property that sets the screen height of the Control. In IE, this unit is in pixels and is write only. For VB, this is in TWIPS. |
| Width | | Read/Write Property that sets the screen width of the Control. In IE, this unit is in pixels and is write-only. For VB, this is in TWIPS. |
| BorderStyle | | Read/Write Property that determines whether the control is bordered (1) or not (0). |
| Quality | | This property determines the intermediate JPEG quality value that will be used when compressing individual images. It may assume a number between 0 and 100 and defaults to 60. |
| FilePath | | Sets the path to which the aquired image will be saved. For example, if you set this to "c:\" then the WebTWAIN control will write the acquired multipage image to the file "c:\scanx.tif". This property defaults to "c:\". |
| SaveAsPDF | | This Boolean specifies whether the generated file should be in PDF (true) or TIFF (false) format. Defaults to True. |
| TiffColours | | String variable that determines the amount of colours per image in the final TIFF image. Valid values are "2", "16", "256", "16g" (16 colour greyscale), "256g" (256 colour greyscale), "" (no colour reduction) |
| TiffInversion | | On some systems, the TIFF produced by the control appears inverted. This Property can be used to instruct the control to invert TIFF colours. Valid values are 0 (for no inversion) or 1 (for inversion). |
| Negotiation (New) | | Read/Write Property that sets whether the control should attempt to pre-negotiate with the TWAIN Driver regarding colour depth, resolution and PaperSize. Valied values are 0 (negotiation disabled) and 1 (negotiation enabled). Defaults to 0 (disabled). |
| PixelType (New) | | Read/Write Property that controls the colour depth at which scanning is to occur. Valid values are number between 0 and 3, with the following meaning: 0 : Black and White 1 : 256 Gray Scale 2 : Millions of Colours 3 : 256 Colour Palette Only relevant if the Negotiation property is set to 1. |
| Resolution (New) | | Read/Write Property that sets the resolution (dpi) at which images should be acquired. Only relevant if the Negotiation Property is set to 1. Defaults to 100 dpi |
| PaperSize (New) | | Read/Write Property that sets the preferred PaperSize for the scan. Useful in ADF Applications, but we don't really know if it works or not :( PaperSize is a number between 1 and 16. The exact significance of each value can be obtained from the method PaperSizeDescription. Only relevant if the Negotiation property is set to 1. Defaults to 1 (A4-LETTER). |
| ScanSource (New) | | Read/Write Property that controls which TWAIN Driver images should be acquired from. Valid values are 0 to the number of TWAIN Drivers on the System. 0 instructs the control to use the default source. Exactly how many TWAIN Drivers are available can be obtained from the TWAINSourceCount and TWAINSourceName methods. Defaults to 0 (default source). |
| ShowUI (New) | | Read/Write Property that controls whether TWAIN Driver's User Interface should be shown on starting an acquisition. Valid values are 0 (No UI shown) and 1 (UI shown). Defaults to 1. Note that if Negotiation is 0, then the UI will always be shown. |
| AutoFinish (New) | | Read/Write Property that controls whether the control should automatically fire the ScanComplete event when scanning has been completed. This is useful in cases where ADF is being used, since the user does not explicity need to click on the Finish button. Setting this to 1 enables AutoFinish, setting to 0 disables AutoFinish. Defaults to 0 (disabled). |
| FullScreen (New) | | Read/Write Property that controls whether the control is to assume fullscreen mode or not. In Fullscreen mode (1), the buttons are not visible and the 4 graphic pages take up the full area of the control. Valid values are 0 (Normal view with buttons) and 1 (FullScreen mode). Defaults to 0. |
|
The following information functions provide more information on the control environment and capabilities: |
| TWAINSourceCount (New) | | Returns the number of installed TWAIN Sources on the client computer. |
| TWAINSourceName(lngX) (New) | | Returns the name of TWAIN Source lngX. Valid values for lngX are 1 to TWAINSourceCount |
| TWAINDefaultSource (New) | | Returns the name of the Default TWAIN Source on the client computer. |
| StartScan() (New) | | Method that can be used to start a scanning process from script. Has the same function as clicking on the control's Scan button. |
|
The following event occurs when the user has completed image acquisition (by clicking on the finish button):
|
| ScanComplete(FileName) | | This event is fired when a TWAIN acquisition has successfully been completed. The event provides a parameter that specifies the full filename of the TIFF of PDF File that the control created. |
|
The following methods are meaningful after acquisition:
|
| CurrentName() | | Returns the name of the acquired TIFF or PDF File. |
| FileSize() | | Returns the filesize of the previously acquired document. |
| Images | | Read-Only Property that returns the amount of images contained within the multi-page document. |
| ImageWidth(n) | | Read-Only Property that returns width (in pixels) of the nth scanned image. The value n is between 1 and the amount of images available. Useful to check whether your user has scanned images that meet your requirements. |
| ImageHeight(n) | | Read-Only Property that returns the height (in pixels) of the nth scanned image. The value n is between 1 and the amount of images available. Useful to check whether your user has scanned images that meet your requirements. |
| PasteName() | | This method will paste the acquired file name to the control's parent window. For Internet Explorer, this will be to the form element that has the focus at the time the method is invoked. This is illustrated in the example below. |
| UploadImage(Svr, UName, Passwd, [Mode], [RemoteName], [RemoteDir]) | | Attempts uploading of the acquired TIFF or PDF file to a remote FTP Server. The parameters are: Svr : FQDN or IP Address of FTP Server UName : FTP UserName Passwd : FTP Password Mode : FTP Transfer Mode (0 = Active (Def), 1 = Passive) RemoteName : Remote filename (defaults to scanx.tif) RemoteDir : (No default)
The function returns a string value that is of zero length if the upload was successful. If any errors occurred, then the function return string contains an applicable errormessage. |
| ClearImages() | | Clears all images and prepares for a new document scan. |