ImageGear for C and C++ on Windows v19.6 - Updated
IG_TWAIN_scan_pages_to_file
API Reference Guide > TWAIN Component API Reference > TWAIN Component Functions Reference > Scanning Functions > IG_TWAIN_scan_pages_to_file

This function is used to scan multiple pages from a scanner equipped with an Automatic Document Feeder (ADF).

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_TWAIN_scan_pages_to_file(
        LPCSTR lpszFileName,
        AT_LMODE nFileFormat,
        AT_BOOL bShowUI
);

Arguments:

Name Type Description
lpszFileName LPCSTR Far pointer to HIGEAR object in which to return ImageGear handle of the acquired image.
nFileFormat AT_LMODE Type of format and compression scheme of file that will be created. accucnst.h contains definitions for formats and compression schemes that have already been "OR'd" together.
bShowUI AT_BOOL This flag determines whether or not the user interface is shown. Set to TRUE if you want ImageGear to obtain the capability settings from the end-user.

Return Value:

Returns the number of ImageGear errors that occurred during this function call. If there are no errors, the return value is IGE_SUCCESS.

Supported Raster Image Formats:

Depends on the scanner driver.

Remarks:

If lpszFileName specifies only a directory but not a file name, a separate file for each page will be created, using the names 0000001.tif, 00000002.tif, 00000003.tif, etc. If those files already exist, they will be deleted before new content is scanned into them.

If lpszFileName specifies a filename and IG_TW_CTRL_SAVE_PAGES_SEPARATELY is set to TRUE, a separate file for each page will be created, but will use part of the name that you supplied. If the name you supplied was "ScanTest.bmp", your pages will be named as follows: ScanTest1.bmp, ScanTest2.bmp, ScanTest3.bmp ... ScanTest10.bmp, ScanTest11.bmp, etc. If these files already exist, they will be deleted before new content is scanned into them.

If IG_TW_CTRL_SAVE_PAGES_SEPARATELY is FALSE, and nFileFormat is set to a format type that supports multiple pages, such as TIFF, DCX, or MO:DCA, the images are stored in one file identified by the lpszFileName parameter.

Use IG_TWAIN_source_open() to select the desired Data Source, and IG_TWAIN_cap_set() to set desired capabilities values, prior to calling this function.