Q: How can I easily scan many pages without user interface?
A: If you want to scan many pages and you have a scan feeder, you can solve this problem with some BITWAIN.OCX methods. You can specify the compression mode of the output file(s) with SetBatchScanImageCompression method (see the description of the method), the output file name and the scanning mode with BatchScan method (see the sample below). You can scan the pages into a multipage tiff file or every page into a single page TIFF file. If you scan single page files, the output files will be numbered. For example the output file name is output.tif, the file names will be output000001.tif, output000002.tif, output000003.tif ect. You can specify the displaying of the pre-scan user. If the pre-scan user interface does not allowed you have many methods in the BITWAIN.OCX to change the scanning properties from the program.
Code example:
iRet = frmMain.Twain1.SetFeederEnable(True)
If iRet <> TW_OK Then
MsgBox "Error setting feeder information.", vbOKOnly, "TWAIN Sample"
End If
…
frmMain.Twain1.BatchScanImageCompression = TCOMP_LZW_DIFF
frmMain.Twain1.MultiPage = True
…
Dim szFileName as String
SzFileName = “c:\scan.tif”
If Len(szFileName) = 0 Then
MsgBox "You must specify the output TIFF file.", vbOKOnly, "TWAIN Sample"
Exit Sub
End If
frmMain.Twain1.BatchScanImageCount = 20
frmMain.Twain1.EnableUI = 1
frmMain.Twain1.FileAcquire = szFileName
frmMain.Twain1.Action = TWSTAT_BATCHSCAN