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

# Comparator オブジェクトの CompareDocuments メソッド

> ABBYY FineReader Engine API の Comparator オブジェクトの CompareDocuments メソッド — このメソッドは、元のDocumentとそのコピーを比較します。

このメソッドは、元のDocumentとそのコピーを比較します。両方のDocumentは、あらかじめ [FRDocument](/ja/fine-reader/engine/api-reference/document-related-objects/frdocument) オブジェクトの [Process](/ja/fine-reader/engine/api-reference/document-related-objects/frdocument/process-method) メソッド (またはDocument合成を実行する別のメソッド) などで認識されている必要があります。

このメソッドは、Documentに加えられたすべての変更内容を含む [ComparisonResult](/ja/fine-reader/engine/api-reference/document-comparison-objects/comparisonresult) オブジェクトを返します。

<div id="syntax">
  ## 構文
</div>

<div id="c">
  ### C++
</div>

```csharp theme={null}
HRESULT CompareDocuments(
  IFRDocument*         RefDocument,
  IFRDocument*         UserDocument,
  IIntsCollection*     RefPageIndices,
  IIntsCollection*     UserPageIndices,
  IComparisonResult**  Result
);
```

### C\#

```csharp theme={null}
IComparisonResult CompareDocuments(
  IFRDocument          RefDocument,
  IFRDocument          UserDocument,
  IIntsCollection      RefPageIndices,
  IIntsCollection      UserPageIndices
);
```

<div id="visual-basic-net">
  ### Visual Basic .NET
</div>

```csharp theme={null}
Function CompareDocuments( _
  RefDocument As IFRDocument, _
  UserDocument As IFRDocument, _
  RefPageIndices As IIntsCollection, _
  UserPageIndices As IIntsCollection _
) As IComparisonResult
```

<div id="parameters">
  ## パラメーター
</div>

RefDocument

\[in] 比較対象の元のDocumentを含む [FRDocument](/ja/fine-reader/engine/api-reference/document-related-objects/frdocument) オブジェクトを参照します。このパラメーターは NULL であってはなりません。

UserDocument

\[in] 比較対象のDocumentのコピーを含む [FRDocument](/ja/fine-reader/engine/api-reference/document-related-objects/frdocument) オブジェクトを参照します。このパラメーターは NULL であってはなりません。

RefPageIndices

\[in] このパラメーターは、元のDocument内のページと比較するページのインデックスを指定する [IntsCollection](/ja/fine-reader/engine/api-reference/supplementary-objects-and-methods/intscollection) オブジェクトを参照します。

UserPageIndices

\[in] このパラメーターは、Documentのコピー内のページと比較するページのインデックスを指定する [IntsCollection](/ja/fine-reader/engine/api-reference/supplementary-objects-and-methods/intscollection) オブジェクトを参照します。

Result

\[out, retval] 出力 [ComparisonResult](/ja/fine-reader/engine/api-reference/document-comparison-objects/comparisonresult) オブジェクトのインターフェース ポインターを受け取る IComparisonResult\* ポインター変数へのポインターです。

<div id="return-values">
  ## 戻り値
</div>

このメソッドに固有の戻り値はありません。[ABBYY FineReader Engine 関数の標準的な戻り値](/ja/fine-reader/engine/api-reference/return-codes)が返されます。

<div id="see-also">
  ## 関連項目
</div>

[Comparator](/ja/fine-reader/engine/api-reference/document-comparison-objects/comparator)
