-f

Top  Previous  Next

-f filename

 

Specifies the name of the image file to be saved.  Unless the -details option is used, the -f option is mandatory and cannot be omitted.

 

If the file name has spaces, the filename must use double quotes to enclose the name.

 

Examples:

 

DTWAIN_TwainSave("-f test.bmp");

DTWAIN_TwainSave(" \"C:\\windows\\My Settings\\test.bmp\"");

 

Note that in the example above, C/C++ escape sequences are used to embed double quotes and backslashes in the string.  Please consult your language as to the proper way to insert double quotes and backslashes within quoted strings.

 

If there are multiple pages to acquire, and

 

a) the -multipage option is not set or

b) the file type does not support multiple pages

 

by specifying the -useinc option, multiple files will be saved using the smart auto-increment feature.  An example of smart auto-increment is the following:

 

If the name of the file is FILE001.BMP, and 4 pages are acquired, the names of the files will be

 

FILE001.BMP

FILE002.BMP

FILE003.BMP

FILE004.BMP

 

If the name of the file is FILE0000.BMP, and 4 pages are acquired, the names of the files generated will be

 

FILE0000.BMP

FILE0001.BMP

FILE0002.BMP

FILE0003.BMP

 

To use auto-increment, the file name should consist of a numeric suffix.  The number of digits in the suffix determines the maximum number of pages that can be acquired without overwriting the files that have already been generated.  For example, a file name of FILE0000.BMP will be able to acquire up to 10,000 pages in a single acquisition without overwriting previous files, since numbers 0000 to 9999 can be generated.  If the number of pages exceeds the number of unique file names that can be generated with the numeric suffix, DTWAIN_TwainSave does not check for file overwrites.  Therefore, you must make sure that the numeric suffix used in the file name is large enough to hold all of the pages that are planned to be acquired.

 

If the file name does not contain a numeric suffix, or if the -usinc option is not specified, the naming convention in auto-increment mode is to append a number to the end of the file name.  The number always starts at 0 up to the total number of pages acquired.  For example, if the base name is FILEABC.BMP, and 4 pages are acquired, the following will be the names of the files:

 

FILEABC0.BMP

FILEABC1.BMP

FILEABC2.BMP

FILEABC3.BMP

 

Using the non-numeric suffix ensures that you will get unique file names, regardless of the number of pages.

 

Default Setting:

There is no default, since the -f option must be specified.