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

# PreprocessPages Method of the FRDocument Object

This method performs preprocessing of the specified pages in the document: corrects page orientation, inversion, geometrical distortions, performs page splitting if necessary. Preprocessing is performed before layout analysis.

## Syntax

### C++

```cpp theme={null}
HRESULT PreprocessPages(
  IIntsCollection*          PageIndices,
  IPagePreprocessingParams* PreprocessingParams,
  IObjectsExtractionParams* ExtractionParams,
  IRecognizerParams*        RecognizerParams
);
```

### C\#

```csharp theme={null}
void PreprocessPages(
  IIntsCollection          PageIndices,
  IPagePreprocessingParams PreprocessingParams,
  IObjectsExtractionParams ExtractionParams,
  IRecognizerParams        RecognizerParams
);
```

### Visual Basic .NET

```vb theme={null}
Sub PreprocessPages( _
  PageIndices As IIntsCollection, _
  [PreprocessingParams As IPagePreprocessingParams = Nothing], _
  [ExtractionParams As IObjectsExtractionParams = Nothing], _
  [RecognizerParams As IRecognizerParams = Nothing] _
)
```

## Parameters

PageIndices

\[in] Refers to the [IntsCollection](/fine-reader/engine/api-reference/supplementary-objects-and-methods/intscollection) object that contains the numbers of pages to be preprocessed.

PreprocessingParams

\[in] Refers to the [PagePreprocessingParams](/fine-reader/engine/api-reference/parameter-objects/preprocessing-analysis-recognition-and-synthesis-parameters/pagepreprocessingparams) object that stores parameters of preprocessing. This parameter may be 0. In this case, the pages are preprocessed with default parameters, or, if a [profile](/fine-reader/engine/guided-tour/advanced-techniques/working-with-profiles) has been loaded, the parameters set by this profile are used.

ExtractionParams

\[in] Refers to the [ObjectsExtractionParams](/fine-reader/engine/api-reference/parameter-objects/preprocessing-analysis-recognition-and-synthesis-parameters/objectsextractionparams) object that stores parameters of objects extraction. This parameter may be 0. In this case, the objects are extracted with default parameters, or, if a [profile](/fine-reader/engine/guided-tour/advanced-techniques/working-with-profiles) has been loaded, the parameters set by this profile are used.

RecognizerParams

\[in] Refers to the [RecognizerParams](/fine-reader/engine/api-reference/parameter-objects/preprocessing-analysis-recognition-and-synthesis-parameters/recognizerparams) object that stores recognition parameters necessary for preprocessing (e.g., recognition language). This parameter may be 0. In this case, the default parameters are used, or, if a [profile](/fine-reader/engine/guided-tour/advanced-techniques/working-with-profiles) has been loaded, the parameters set by this profile are used.

## Return values

If document processing is interrupted by the user, this method will return E\_ABORT. It also returns the [standard return codes of ABBYY FineReader Engine functions](/fine-reader/engine/api-reference/return-codes).

## Remarks

* This method may report events to the listeners attached to the IConnectionPointContainer interface of the [FRDocument](/fine-reader/engine/api-reference/document-related-objects/frdocument) object.
* For Linux and Windows: Depending on the value of the [IEngine::MultiProcessingParams](/fine-reader/engine/api-reference/engine-object-iengine-interface/properties#multiprocessingparams) property, ABBYY FineReader Engine can distribute preprocessing of multi-page documents to CPU cores.

## See also

[FRDocument](/fine-reader/engine/api-reference/document-related-objects/frdocument)

[Working with Profiles](/fine-reader/engine/guided-tour/advanced-techniques/working-with-profiles)
