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

# AddPages Method of the ExportFileWriter Object

<Warning>
  The ExportFileWriter object is deprecated and will be removed in future versions.
</Warning>

This method saves recognized text from a set of pages into a file in PDF format. The method can be called several times till all recognized pages are saved into the file.

<Warning>
  If the exported pages have been obtained via the [FRDocument](/fine-reader/engine/api-reference/document-related-objects/frdocument) object, they must all belong to the same document. If you try to export the pages from different FRDocument objects an error will occur.
</Warning>

## Syntax

### C++

```cpp theme={null}
HRESULT AddPages(
  IFRPages*  Pages,
  IIntsCollection* Indices
);
```

### C\#

```csharp theme={null}
void AddPages(
  IFRPages Pages,
  IIntsCollection Indices
);
```

### Visual Basic .NET

```vb theme={null}
Sub AddPages( _
  Pages As IFRPages, _
  Indices As IIntsCollection _
)
```

## Parameters

Pages

\[in] Refers to the [FRPages](/fine-reader/engine/api-reference/document-related-objects/frpages) object that contains the pages to be exported. This parameter must not be 0.

Indices

\[in] This parameter refers to the [IntsCollection](/fine-reader/engine/api-reference/supplementary-objects-and-methods/intscollection) object which specifies the indices of the pages which have to be added to a document. This parameter is optional and may be 0, in which case all the pages of the opened file will be added to the document.

<Warning>
  The Indices parameter must not include duplicates. For exporting one page several times over use the [AddPage](/fine-reader/engine/api-reference/mechanism-objects/exportfilewriter/addpage-method) method repeatedly.
</Warning>

## Remarks

* To export the document incrementally at a greatest possible speed add 30 pages at a time, with [IFRDocument::PageFlushingPolicy](/fine-reader/engine/api-reference/document-related-objects/frdocument#pageflushingpolicy) set to PFP\_Auto or PFP\_KeepInMemory.

* The order of the exported pages is the same as in the original document. The Indices parameter only identifies the pages for export and does not indicate their sequence. If you want to export the pages in a different order, use several calls to the [AddPage](/fine-reader/engine/api-reference/mechanism-objects/exportfilewriter/addpage-method) method.

* In 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 export of multi-page documents to CPU cores.

## Return values

This method has no specific return values. It returns the [standard return values of ABBYY FineReader Engine functions](/fine-reader/engine/api-reference/return-codes).

## See also

[ExportFileWriter](/fine-reader/engine/api-reference/mechanism-objects/exportfilewriter)

[AddPage](/fine-reader/engine/api-reference/mechanism-objects/exportfilewriter/addpage-method)

[Close](/fine-reader/engine/api-reference/mechanism-objects/exportfilewriter/close-method)
