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

# IBatch

> IBatch represents a batch in FlexiCapture scripts: move and delete documents and pages, create pages from images, and read batch properties and SLA data.

## What it does

Represents the batch.

<a id="webverificationavailableinterface" />

<Note>
  Some methods and properties of this object are not available on the Web Verification Station for checking rules locally. The methods and properties that are not supported are marked with an asterisk (\*).
</Note>

## Methods

<Warning>
  The methods below require permissions for changing the batch structure. These methods can be called only from the [batch processing](/flexi-capture/appendix/scripts/scripts-handling#batchprocessingscript) script.
</Warning>

<table width="100%"><thead><tr><th style={{textAlign: 'left'}}><p><strong>Definition</strong></p></th><th style={{textAlign: 'left'}}><p><strong>Description</strong></p></th></tr></thead><tbody><tr><td><p>CleanRecognitionResults( document : <a href="/flexi-capture/appendix/scripts/idocument">IDocument</a> ) <a href="#webverificationavailableinterface">\*</a></p></td><td><p>Deletes recognition results for the document.</p></td></tr><tr><td><p>CreateDocumentFromPage( targetPosition : int, page : <a href="/flexi-capture/appendix/scripts/ipage">IPage</a> ): <a href="/flexi-capture/appendix/scripts/idocument">IDocument</a> <a href="#webverificationavailableinterface">\*</a></p></td><td><p>Takes a page from the document and creates a new document from that page. In the <strong>targetPosition</strong> parameter, specify an index for the new document in the batch. The index must be a number between 0 and N, N being the total number of documents in the batch.</p><p>When the <strong>CreateDocumentFromPage </strong>method is called:</p><ul><li>The documents having indexes from <strong>0</strong> to <strong>targetPosition – 1</strong> will remain in their original positions.</li><li>The documents having indexes from <strong>targetPosion</strong> to <strong>N</strong> will be moved one position forward.</li><li>The new document will be placed in the vacated <strong>targetPosition</strong>.</li></ul><p><strong>Note: </strong> If the document becomes empty after the page is removed, it will be deleted.</p><details><summary>Example</summary><p>An example of a script for processing the first document:</p><pre><code>IDocument document = Documents\[0];
for( int i = document.Pages.Count - 1; i >= 0; --i )
\{
   Batch.CreateDocumentFromPage( document.Index + 1, document.Pages\[i] );
}</code></pre></details></td></tr><tr><td><p>CreatePageFromImage( page : <a href="/flexi-capture/appendix/scripts/ipictureobject">IPictureObject</a>, \[optional] target : <a href="/flexi-capture/appendix/scripts/idocument">IDocument</a>, \[optional] position : int, \[optional] sourceInfo : string ) : <a href="/flexi-capture/appendix/scripts/ipage">IPage</a> <a href="#webverificationavailableinterface">\*</a></p></td><td><p>Creates a page from the <a href="/flexi-capture/appendix/scripts/ipictureobject">IPictureObject</a> object and returns the created page:</p><ul><li>If a target document is specified, the page is added to this document. To create a one-page document, specify <strong>null</strong> as a target document.</li><li>If a position is specified, the page is added to the specified position of the document (if a target document is specified). Otherwise a one-page document is added to the specified position of the batch (if <strong>null</strong> is specified as a target document). The initial position corresponds to "0," the end of the document or batch corresponds to "-1."</li><li>If the <strong>sourceInfo</strong> parameter is specified it is written into the information about the page source. Otherwise, information about the page source is received from <a href="/flexi-capture/appendix/scripts/ipictureobject">IPictureObject</a>.</li></ul></td></tr><tr><td><p>DeleteDocument( document : <a href="/flexi-capture/appendix/scripts/idocument">IDocument</a> ) <a href="#webverificationavailableinterface">\*</a></p></td><td><p>Deletes the document.</p></td></tr><tr><td><p>DeletePage( page : <a href="/flexi-capture/appendix/scripts/ipage">IPage</a> ) <a href="#webverificationavailableinterface">\*</a></p></td><td><p>Deletes the page.</p></td></tr><tr><td><p>MoveDocument( source : <a href="/flexi-capture/appendix/scripts/idocument">IDocument</a>, targetPosition : int ) <a href="#webverificationavailableinterface">\*</a></p></td><td><p>Moves the document to the specified position in the batch.</p></td></tr><tr><td><p>MovePage( source : <a href="/flexi-capture/appendix/scripts/idocument">IDocument</a>, target : <a href="/flexi-capture/appendix/scripts/idocument">IDocument</a>, sourcePageIndex : int, int targetPageIndex : int ) <a href="#webverificationavailableinterface">\*</a></p></td><td><p>Moves the page with the sourcePageIndex index from the source document to the targetPageIndex position in the target document.</p></td></tr></tbody></table>

## Properties

<table width="100%"><thead><tr><th style={{textAlign: 'left'}}><p><strong>Name</strong></p></th><th style={{textAlign: 'left'}}><p><strong>Type</strong></p></th><th style={{textAlign: 'left'}}><p><strong>Access</strong></p></th><th style={{textAlign: 'left'}}><p><strong>Description</strong></p></th></tr></thead><tbody><tr><td><p>AsBatchItem <a href="#webverificationavailableinterface">\*</a></p></td><td><p><a href="/flexi-capture/appendix/scripts/i-batch-item">IBatchItem</a></p></td><td><p>Read-only</p></td><td><p>Converts the batch into an <a href="/flexi-capture/appendix/scripts/i-batch-item">IBatchItem</a> object.</p></td></tr><tr><td><p>Attachments</p></td><td><p><a href="/flexi-capture/appendix/scripts/iattachments">IUserAttachments</a></p></td><td><p>Read-only</p></td><td><p>User attachments.</p></td></tr><tr><td><p>BatchTypeName</p></td><td><p>string</p></td><td><p>Read-only</p></td><td><p>The name of the batch type.</p></td></tr><tr><td><p>Comment</p></td><td><p>string</p></td><td><p>Read/write</p></td><td><p>The comment.</p></td></tr><tr><td><p>CreatedBy</p></td><td><p><a href="/flexi-capture/appendix/scripts/iprincipal">IPrincipal</a></p></td><td><p>Read-only</p></td><td><p>The author of the newly created batch.</p><p>For the Standalone version of FC, returns <strong>null</strong>.</p></td></tr><tr><td><p>CreationDate</p></td><td><p>DateTime</p></td><td><p>Read-only</p></td><td><p>The time when the batch was created.</p></td></tr><tr><td><p>Documents</p></td><td><p><a href="/flexi-capture/appendix/scripts/idocuments">IDocuments</a></p></td><td><p>Read-only</p></td><td><p>Documents the batch consists of</p></td></tr><tr><td><p>Id</p></td><td><p>int</p></td><td><p>Read-only</p></td><td><p>The batch identifier (unique within the project).</p></td></tr><tr><td><p>Name</p></td><td><p>string</p></td><td><p>Read/write</p></td><td><p>The name of the batch.</p></td></tr><tr><td><p>Priority</p></td><td><p><a href="/flexi-capture/appendix/scripts/tprocessingpriority-appendix-scripts">TProcessingPriority</a></p></td><td><p>Read/write</p></td><td><p>The priority of the batch.</p></td></tr><tr><td><p>Project</p></td><td><p><a href="/flexi-capture/appendix/scripts/iproject">IProject</a></p></td><td><p>Read-only</p></td><td><p>The project containing the batch.</p></td></tr><tr><td><p>Properties</p></td><td><p><a href="/flexi-capture/appendix/scripts/iproperties">IProperties</a></p></td><td><p>Read-only</p></td><td><p>Named parameters of the batch.</p></td></tr><tr><td><p><a id="ibatch-slaexpirationdate" />SLAExpirationDate</p></td><td><p>DateTime</p></td><td><p>Read/write</p></td><td><p>Processing deadline of the batch.</p></td></tr><tr><td><p>SlaStartDate</p></td><td><p>DateTime</p></td><td><p>Read-only</p></td><td><p>The time when processing of the batch started.</p></td></tr><tr><td><p>SlaWarningPeriod <a href="#webverificationavailableinterface">\*</a></p></td><td><p>Int</p></td><td><p>Read/write</p></td><td><p>The starting time of the period during which a warning about the task's approaching deadline will be displayed. Specified in minutes remaining until the deadline.</p></td></tr><tr><td><p>StageInfo</p></td><td><p><a href="/flexi-capture/appendix/scripts/istageinfo">IStageInfo</a></p></td><td><p>Read-only</p></td><td><p>Returns the <a href="/flexi-capture/appendix/scripts/istageinfo">IStageInfo</a> object with information about the document's processing stage. The TaskId and PrincipalId fields are not used.</p></td></tr></tbody></table>
