-F

Top  Previous  Next

-F filetype

 

The -F parameter determines the image file type that will be saved.  If -F is not specified, the file type will be a Windows BMP file.  If the -multipage option is used, the file will be a multipaged image file (only TIFF, PCX, PDF, and PostScript formats allow multi-page image files).

 

The valid values for -F are as follows:

 

bmp

Windows BMP file

emf

Enhanced Windows meta-file format

gif

Compuserve GIF format

ico

Windows ICON format

icov

Vista-compatible ICON format (width/height > 255 pixels)

jpeg

JPEG format

jp2

JPEG-2000 format

pcx

PCX format

pdf

Adobe PDF format

png

Portable Network Graphics (PNG) format

psd

Adobe Photoshop format

ps1

PostScript Level 1 format

ps2

Postscript Level 2 format

tga

Targa Format

tif1

uncompressed TIFF image

tif2

TIFF using PackBits compression

tif3

TIFF using Group 3 Fax compression

tif4

TIFF using Group 4 Fax compression

tif5

TIFF using JPEG compression

tif6

TIFF using Flate compression

tif7

TIFF using LZW compression

wbmp

Wireless Bitmap format.

wmf

Windows Meta File.

                     

Example:  Acquire to a Group 3 TIFF format, the file is called mytif.tif:

DTWAIN_TwainSave("-F tif3 -f mytif.tif");

 

If the device cannot save to the file type specified, this will usually mean one of the following:

 

There was a general problem in saving the file (disk full, user does not have write access to the drive and directory, etc.) or

 

TWAIN device did not or could not acquire the image in the proper format.  For example, a Group 3 TIFF is specified (-F tif3), however the device acquired a color image.  Color images cannot be saved to Group 3 or Group 4 TIFF files.  You would see the following in a command-line window if the -verbose option is specified, or in the log file specified by -verboselog:

 

clip0021

 

The error states that the device is attempting to transfer 8 bit images (usually color or gray scale), but the image format specified (TIFF Group 3) does not support color or gray-scale images.

 

If the device's user interface is shown, the user may have chosen an incorrect type that matches the format given on the DTWAIN_TwainSave command line.  Therefore it is highly recommended that if you plan to use DTWAIN_TwainSave, and the device's user interface will be available to the user, to select a file format that gives you the most supported types of colors.  For example BMP supports both monochrome, gray-scale, and color images, as do all forms of TIFF except for Group 3, Group 4 TIFF, and TIFF-JPEG.

 

Here are the list of file types, and the bits-per-pixel supported for each one:

 

Below is a table describing the valid bit-depths for each file type:

 

File Type        Bit Depth

bmp

Any bit depth

ico, icov

8, 24

jpeg, jp2

8, 16, or 24

pcx        

1, 8 or 24

tga

8 or 24

tif1, tif2, tif5, tif7        

1, 4, 8, 16, or 24

tif3, tif4

1

tif6

8, 16, 24

emf, wmf

24

gif

1, 8

png

1, 8, 16, or 24

psd

24

pdf

1, 8, 16, 24

ps1, ps2

1, 8, 16, 24

wbmp

1

 

1 bit-per-pixel are monochrome (black/white) images.

4 bits-per-pixel are usually gray-scale images.

8 bits-per-pixel are usually gray-scale and 256 color images.

16 and 24 bits-per-pixel are usually color images.

 

Note:  Bit depths higher than 24 should be stored as bmp files.

 

 

Default Setting:

The image type is bmp (Windows BMP).