BatchScan

#include "BiTwain.h"

 

int CALLBACK BatchScan(    LPCTSTR filename,
BOOL       bMultiPage,
UINT        nPages)

Description

This function should be called to start software batch scanning. The filename parameter must be a valid filename, or NULL. This function scans from the feeder to the specified TIF file. The filename parameter will be used as the output file name. If bMultiPage is TRUE, all scanned images will be scanned to the multipage TIFF file, otherwise every page will be scanned a single page TIFF file. If the filename parameter is NULL, every page will be scanned into memory.The nPages parameter specifies the number of pages to scan from the feeder. If the nPages parameter is 0, all of the paper will be scanned from the feeder. This function can be used if the scanner has an ADF (automatic document feeder). This function scans the page to memory and saves it to the TIFF file. You can specify the image compression by SetBatchScanImageCompression function. When one page is scanned and saved the WM_BI_PAGE_FINISHED message will be sent. The lParam is a pointer to the structure containing information about batch scanning.

typedef struct tagstScanningDocumentFinished

{

            HANDLE hDib;

            LPCWSTR lpFileName;

 }stScanningDocumentFinished, *lpstScanningDocumentFinished;

 

hDib contains the handle of the DIB scanned. The lpFileName contains the path and name of  the file or NULL. The user should free the allocated memory for hDib.

When feeder is empty the WM_BI_FEEDER_EMPTY message will be sent.

Parameters

LPCTSTR

filename

The full path of the output file or NULL.

BOOL

bMultiPage

If TRUE the output will be a multipage TIFF file, otherwise every page will be scanned into a seperate TIFF file.

UINT

nPages

Number of pages to scan.

Additional Information

This example shows how to use the dll when loading statically including the header file. Otherwise if the dll is loaded dynamically, for further information read the “About the difference of static and dynamic library loading” section of the manual.

Return values

Return TW_OK on success or an error code on failure.

Requirements

Header :     Declared in BiTwain.h; include BiTwain.h.

Library :    Use BiTwain.lib.

DLLs :       BiTwain.dll.