Sets the absolute file name (including its path) and file format to be used in File Transfer Mode.


.SetFileXferInfo(string fileName, EnumDWT_FileFormat fileFormat);


<string> fileName

The name of the file to be used in the transfer. For example: "C:\\webtwain.jpg".
When you write the name like this string + %d +
string, then when you scan multiple files, the name will automatically change. For example: "C:\\webtwain" + <> + ".jpg" will result in "C:\\webtwain0.jpg",
"C:\\webtwain1.jpg", "C:\\webtwain2.jpg", etc. By doing this, you are now able to scan multiple files to the disk.

EnumDWT_FileFormat fileFormat

An enumerated value that indicates the format of the image. For example: EnumDWT_FileFormat.TWFF_JFIF

Allowed formats

Format Value Description
TWFF_TIFF 0 Tagged Image File Format. Used for document imaging. Native Linux format
TWFF_PICT 1 Native Macintosh format
TWFF_BMP 2 Native Microsoft format
TWFF_XBM 3 X-Windows Bitmap used for document imaging
TWFF_JFIF 4 JPEG File Interchange Format. Wrapper for JPEG images
TWFF_FPX 5 FlashPix, used with digital cameras
TWFF_TIFFMULTI 6 Multi-page TIFF files
TWFF_PNG 7 An image format standard intended for use on the web, replaces GIF
TWFF_SPIFF 8 A standard from JPEG, intended to replace JFIF, also supports JBIG
TWFF_EXIF 9 File format for use with digital cameras
TWFF_PDF 10 A file format from Adobe (TWAIN Spec 1.91)

11 A file format from the Joint Photographic Experts Group ISO/IEC 15444-1 (TWAIN Spec 1.91)
TWFF_JPX 13 A file format from the Joint Photographic Experts Group ISO/IEC 15444-2 (TWAIN Spec 1.91)
TWFF_DEJAVU 14 A file format from LizardTech (TWAIN Spec 1.91)
TWFF_PDFA 15 A file format from Adobe PDF/A, Version 1 (TWAIN Spec 2.0)
TWFF_PDFA2 16 A file format from Adobe PDF/A, Version 2 (TWAIN Spec 2.1)

Return value


true indicates success. false indicates failure.

When false is returned, check ErrorCode or ErrorString for error information.


The SetFileXferInfo() method is valid only in File Transfer Mode.
In File Transfer Mode, the image is transferred to the designated location on the disk directly instead of Dynamic Web TWAIN.

Make sure the format you set is supported by the Data Source (your scanner).

DWObject.TransferMode = EnumDWT_TransferMode.TWSX_FILE;
if(DWObject.TransferMode == EnumDWT_TransferMode.TWSX_FILE){
	if(DWObject.SetFileXferInfo("C:\\Temp\\WebTWAIN<>.bmp", EnumDWT_FileFormat.TWFF_BMP)){
		DWObject.IfShowUI = true;		

See also


Is this page helpful?

Leave a Reply

Your email address will not be published.