> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Scanning with ABBYY FlexiCapture SDK

ABBYY FlexiCapture SDK offers a [**ScanManager**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/scanmanager.md) object for managing the scanning sources. The **ScanSourcesEx** property of this object provides access to the list of all available scanners, while the [**FindScanSources**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/scanmanager-findscansources.md) method allows you to select the scanners by API type they provide and the user interface type you wish to use to set scanning options.

To scan and save the files to disk you can use either of these two methods of the [**ScanSource**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/scansource.md) object: [**Scan**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/scansource-scan.md) method, which does not return until the scanning is complete, and [**BeginScan**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/scansource-beginscan.md) method, which starts the asynchronous scanning operation and returns immediately.

You can implement the [**IScanCallback**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/iscancallback.md) interface and use it to get notifications about the progress of scanning.

The following parameters are accessible via the ABBYY FlexiCapture 12 SDK API: brightness, color, resolution, image compression type, image rotation angle, the size of the scanning area, duplex scanning mode, automatic feeder mode, a pause between pages and some more. The scanning parameters are set by using the [**ScanSettings**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/scansource.md#scansettings) property of the **ScanSource** object. This property is required to get access to the [**ScanSourceSettings**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/scansourcesettings.md) object which, in its turn, provides access to the scanning settings of a source.

You can find some useful recommendations as to the preferable scanning options in the [Tips for Document Scanning](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/tipsforscanning.md) section.

To scan the images synchronously:

1. Create a [**ScanManager**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/scanmanager.md) object using the [**CreateScanManager**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/engine-createxxx.md) method of the [**Engine**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/engine.md) object.
2. Select the scanning source using the [**FindScanSources**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/scanmanager-findscansources.md) method of the **ScanManager** object, specifying the API and UI type that should be supported by the scanner.
3. If you choose to display no dialog box for the user to set scanning options him- or herself, tune the scanning options using the [**ScanSettings**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/scansource.md#scansettings) property of the chosen [**ScanSource**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/scansource.md). Select the appropriate values for brightness, resolution, and the other parameters in the corresponding properties of the **ScanSourceSettings** object. You can check which settings are available for this scanner using the **Capabilities** property of the **ScanSource**.
4. Create or choose an existing folder in which scanned pages will be stored. Put the folder name into a **BSTR** variable, for example, **ScanFolder**.
5. Call the [**Scan**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/scansource-scan.md) method of the **ScanSource** object, providing as the parameter the type of dialog box to be shown to the user (pass SOIT\_None constant to display no box), and the **ScanFolder** path to the folder with the results.
6. The image file names will be returned by this method as a [**StringsCollection**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/stringscollection.md) object. You can get the image file names from this **StringsCollection** object and then process the files as usual.

To scan the images asynchronously:

1. Create an object implementing the [**IScanCallback**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/iscancallback.md) interface. In case of asynchronous scanning operation, notifications from callback interface are very useful.
2. Create a **ScanManager** object using the [**CreateScanManager**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/engine-createxxx.md) method.
3. Select the scanning source using the [**FindScanSources**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/scanmanager-findscansources.md) method of the **ScanManager** object, specifying the API and UI type that should be supported by the scanner.
4. If you choose to display no dialog box for the user to set scanning options him- or herself, tune the scanning options using the [**ScanSettings**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/scansource.md#scansettings) property of the chosen **ScanSource**. Select the appropriate values for brightness, resolution, and the other parameters in the corresponding properties of the **ScanSourceSettings** object. You can check which settings are available for this scanner using the **Capabilities** property of the **ScanSource**.
5. Create or choose an existing folder in which scanned pages will be stored. Put the folder name into a **BSTR** variable, for example, **ScanFolder**.
6. Call the [**BeginScan**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/scansource-beginscan.md) method of the **ScanSource** object, providing as the parameter the type of dialog box to be shown to the user (pass SOIT\_None constant to display no box), and the **ScanFolder** path to the folder with the results. You also need to pass the pointer to the callback object you created.
7. The path to image file is returned with the [**OnImageScanned**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/iscancallback-onimagescanned.md) notification of the **IScanCallback** interface, and the completion of the operation is signalled by the [**OnScanComplete**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/iscancallback-onscancomplete.md) notification. As you are providing the implementation for these methods, you can choose what to do in each of these situations.

> [!WARNING]
>
> Until the scanning is completed and the **OnScanComplete** notification received, you cannot run **BeginScan** or **Scan** again, even for some other scanner. The advantage of asynchronous scanning is not that you can perform several scanning operations at once, but that you can process the images you already received while the new images are being scanned.

## See also

[**ScanManager**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/scanmanager.md)

[**ScanSource**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/scansource.md)
