Downloads an image from the HTTP server.
Namespace: Dynamsoft.DotNet.TWAINAssembly: DynamicDotNetTWAIN (in DynamicDotNetTWAIN.dll) Version: 3.0.0.0 (3.0.0.0)
Syntax
| C# |
|---|
public bool HTTPDownloadEx( string strHTTPServer, string strHTTPRemoteFile, DWTImageFileFormat enumImageType ) |
| Visual Basic |
|---|
Public Function HTTPDownloadEx ( _ strHTTPServer As String, _ strHTTPRemoteFile As String, _ enumImageType As DWTImageFileFormat _ ) As Boolean |
Parameters
- strHTTPServer
- Type: System..::..String
The name of the HTTP server.It should be only the name of the HTTP server, without "http://" or "https://".Port number is not needed here.
- strHTTPRemoteFile
- Type: System..::..String
The name of the image to be downloaded. It should be the relative path of the file on the HTTP server.
- enumImageType
- Type: Dynamsoft.DotNet.TWAIN.Enums..::..DWTImageFileFormat
The image format of the file to be downloaded.
Return Value
True indicates success. False indicates failure.
Remarks
Dynamic .NET TWAIN processes the image format according to the value of the ImageType.
DWTImageFileFormat Allowed Values ImageType
WEBTW_BMP BMP
WEBTW_JPG JPEG
WEBTW_TIF TIFF
WEBTW_PNG PNG
WEBTW_PDF PDF
HTTPRemoteFile parameter should include the HTTP directory of the file.
The image downloaded will be displayed in Dynamic .NET TWAIN, just as it is acquired from a TWAIN Data Source.
Exceptions
| Exception | Condition |
|---|---|
| Dynamsoft.DotNet.TWAIN..::..TwainException | When an error occurs and IfThrowException property is true, an exception will be thrown. When IfThrowException property is false, please check ErrorCode and ErrorString. |