> ## 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.

# ステップ 5: 結果のエクスポート

[ドキュメントの認識](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/engine-recognizing.md)が完了したら、認識データを保存する必要があります。ABBYY FlexiCapture 12 SDK では、認識データを XLS、XLSX、DBF、TXT、CSV、または XML 形式のファイルに保存できるほか、ドキュメントの電子コピーを PDF や PDF/A などの形式で保存できます。保存には、[**Project**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/project.md) オブジェクトまたは [**Batch**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/batch.md) オブジェクトの **Export** メソッドを使用します。前者は複数のバッチから結果をエクスポートでき、後者はバッチ内の複数のドキュメントをエクスポートします。また、[**ExportProfiles**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/exportprofiles.md) オブジェクトの [**AddNew**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/exportprofiles-addnew.md) メソッドを使用して、指定したエクスポートパラメーターを持つエクスポートプロファイルを Document Definition 内に作成することもできます。

![](https://mintcdn.com/abbyy/DG4YBah30S0eFFo5/images/flexi-capture/sdk/TutorialProject_Export.jpg?fit=max\&auto=format\&n=DG4YBah30S0eFFo5\&q=85\&s=20ca207334b18bad15db240d46b73fa5)

手順は次のとおりです。

1. \[オプション] [**IntsCollection**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/intscollection.md) オブジェクトを作成し、エクスポートするバッチ内のドキュメント (またはプロジェクト内のバッチ) を指定します。NULL オブジェクトを渡すと、バッチ内のすべてのドキュメント (またはプロジェクト内のすべてのバッチ) をエクスポートできます。
2. \[オプション] [**ExportParams**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/exportparams.md) オブジェクトを作成し、エクスポートパラメーターを指定します。現在利用できるのはファイルへのエクスポートのみです。詳細については、[エクスポートパラメーターの調整](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/exportparams.md)セクションを参照してください。
3. [**Batch**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/batch-export.md) (または [**Project**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/project-export.md)) オブジェクトの **Export** メソッドを呼び出し、指定した形式でドキュメントをファイルに保存します。
4. バッチでの作業が完了したら、対応する **Batch** オブジェクトの [**Close**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/batch-close.md) メソッドを呼び出してバッチを閉じ、リソースを解放します。
5. プロジェクトでの作業が完了したら、**Project** オブジェクトの [**Close**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/project-close.md) メソッドを呼び出してプロジェクトを閉じ、リソースを解放します。

> [accordion] C++ (COM) コード
>
> ```cpp theme={null}
> // Global ABBYY FlexiCapture SDK Engine object.
> // Create the Engine object
> ...
> // Open a project
> FCEngine::IProjectPtr project = Engine->OpenProject( L"D:\\TestProject\\TestProject.fcproj" );
> // Add a new batch
> FCEngine::IBatchPtr batch = project->Batches->AddNew( L"TestBatch" );
> // Open the batch
> batch->Open();
> // Add some images to the batch
> ...
> // Recognize the documents
> batch->Recognize( 0, FCEngine::RM_ReRecognizeMinimal, 0 );
> batch->Export( 0, 0 );
> // Close the batch and the project when you're done
> batch->Close();
> project->Close();
> ```

この手順は ABBYY FlexiCapture 12 SDK のサンプルで使用されています。サンプルは **Samples** フォルダー (Start > Programs > ABBYY FlexiCapture 12 SDK > Code Samples Folder) にあります。

## 補足

[エクスポートパラメーターを変更する](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/exportparams.md)こともできます。デフォルトでは、ドキュメント定義で指定されたパラメーターが使用されます。

ABBYY FlexiCapture 12 SDK のエクスポートメソッドが何らかの理由で用途に合わない場合は、独自のエクスポート処理を実装できます。たとえば、ドキュメントの[すべての field を走査](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/workingwithrecognizeddata.md)して、その値をエクスポートすることもできます。

## 関連項目

[最終ステップ：FlexiCapture 12 SDK のアンロード](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/engine-unloading.md)

[ステップ 4：ドキュメントの認識](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/engine-recognizing.md)
