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

# IWorkspaceItem

> IWorkspaceItem object in the ABBYY Scanning Station scripting model: methods and properties for editing, cropping, converting, and saving batch pages.

## What it does

Represents an item of the workspace. Can be a batch, a document or a page.

## Methods

| **Definition**                                                                                                                                                 | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ApplyAutoLevelsFilter()                                                                                                                                        | **Important:** This method is applicable only to gray and color images. Automatically configures settings and applies the AdjustLevels filter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ApplyPageProfile( name: string, \[optional] onlyModificators: bool )                                                                                           | Applies the selected [enhancement profile](/flexi-capture/scanning-station/shared/scan-station/how-to-image-enhancement-profile) to an image. See [Apply an enhancement profile](#apply-an-enhancement-profile).                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ApplyShadowsHighlightsFilter()                                                                                                                                 | **Important:** This method is applicable only to gray and color images. Applies a locally adaptive image contrast enhancement.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ApplySigmaFilter()                                                                                                                                             | **Important:** This method is applicable only to gray and color images. Applies a sigma filter to delete digital noise from images.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| AutoCrop( \[optional] type: string )                                                                                                                           | Automatically searches for page boundaries on an image, crops the area that contains data for extraction, and corrects skews and distortions. Possible values of the optional type are **Photo**, **Scan**, **Generic**.                                                                                                                                                                                                                                                                                                                                                                                                                            |
| BackToSourceImage()                                                                                                                                            | Returns to the source image.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ChangeResolution( int )                                                                                                                                        | Changes image resolution on a page (or all pages) of a document or a batch to the specified value.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ConvertToBW()                                                                                                                                                  | Converts a page (or all pages) of a document or a batch to black-and-white.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Copy( target: IWorkspaceItem, \[optional] inside: bool ): IWorkspaceItem                                                                                       | Copies a document or a page after the target item, or inside it. A target can be a batch, document or page. Insertion can be made after the target at the same level (if the **inside** parameter is set to "false") or inside the target at the beginning of the list (if the **inside** parameter is set to "true").                                                                                                                                                                                                                                                                                                                              |
| CorrectBrightness( brightness: int )                                                                                                                           | **Important:** This method is applicable only to gray and color images. Corrects the brightness of an image. Possible values are from -100 to 100.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| CorrectContrast( contrast: int )                                                                                                                               | **Important:** This method is applicable only to gray and color images. Corrects the contrast of an image. Possible values are from -100 to 100.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Crop( rect: [IPageRect](/flexi-capture/scanning-station/shared/scripts/pagerect) )                                                                             | Crops an area on a page (or all pages) of a document or a batch.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Deskew( \[optional] byLines: bool, \[optional] byBlackSquares: bool, \[optional] byText: bool )                                                                | Deskews a page (or all pages) of a document or a batch. By default, the **byLines** and **byBlackSquares** parameters are set to "false" while the **byText** parameter is set to "true".                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Despeckle( \[optional] garbageSize: VARIANT )                                                                                                                  | Despeckles a page (or all pages) of a document or a batch.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Erase( rect: [IPageRect](/flexi-capture/scanning-station/shared/scripts/pagerect), \[optional] rColor: int, \[optional] gColor: int, \[optional] bColor: int ) | Erases an area on a page (or all pages) of a document or a batch.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| FlipHorizontal()                                                                                                                                               | Flips a page (or all pages) of a document or a batch horizontally.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| FlipVertical()                                                                                                                                                 | Flips a page (or all pages) of a document or a batch vertically.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| FreeScale( newWidth: int, newHeight: int, newResolution: int )                                                                                                 | Scales a page (or all pages) of a document or a batch according to specified values.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Invert( \[optional] rect: [IPageRect](/flexi-capture/scanning-station/shared/scripts/pagerect) )                                                               | Inverts a page (or all pages) of a document or a batch.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| IsPhoto: bool                                                                                                                                                  | Shows whether an image is a photo.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| IsSuitableForOcr: bool                                                                                                                                         | Shows whether an image is suitable for OCR.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Move( target: IWorkspaceItem, \[optional] inside: bool )                                                                                                       | Moves a document or a page after the target item, or inside it. A target can be a batch, document or page. Insertion can be made after the target at the same level (if the **inside** parameter is set to "false") or inside the target at the beginning of the list (if the **inside** parameter is set to "true").                                                                                                                                                                                                                                                                                                                               |
| RemoveGeometricalDistortions()                                                                                                                                 | Corrects geometrical distortions of trapeziums and crooked lines on an image.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| RemoveMotionBlur()                                                                                                                                             | **Important:** This method is applicable only to gray and color images. Detects and removes blur that is caused by moving a document or a camera/scanner.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| RemoveScannerShadowFromImage()                                                                                                                                 | Removes shadow from a scanner (for example, in the center spread).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| RemoveStamps( colorToFilter: string, \[optional] rect: [IPageRect](/flexi-capture/scanning-station/shared/scripts/pagerect) )                                  | **Important:** This method can only be applied to color images. Removes stamps from images. **colorToFilter** — the color of the stamps you want to remove. Accepts string values **Red**, **Green**, **Blue**, and **Yellow** (not case-sensitive). **rect** — the area of the image from which you want to remove stamps. If this parameter is not specified, stamps are removed from the entire image. See [Remove stamps from part of an image](#remove-stamps-from-part-of-an-image).                                                                                                                                                          |
| RemoveStampsExt( colorsToFilter: string )                                                                                                                      | **Important:** This method is applicable only to color images. Removes stamps from images. **colorsToFilter** — the color of stamps for deletion. String values: **Red**, **Green**, **Blue**, **Yellow**, **Orange**, **LightBlue**, **Purple** (regardless of register). You can specify several values separated by a comma (for example, "**Red, Green**"). You can also specify a blank line as a value (""). In this case, colors to be deleted are selected automatically, and the program deletes all colors found on an image from the set of allowable values. See [Remove stamps of specific colors](#remove-stamps-of-specific-colors). |
| ResetPageProfile()                                                                                                                                             | Resets the [image enhancement profile](/flexi-capture/scanning-station/shared/scan-station/how-to-image-enhancement-profile) and discards all changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Rotate( angle: int )                                                                                                                                           | Rotates a page (or all pages) of a document or a batch.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| SaveAs( fileName: string, \[optional] options: [IImageSavingOptions](/flexi-capture/scanning-station/shared/scripts/saving-options) )                          | Saves pages, a page image, or a batch to a file. When saving a multi-page document (or a batch) in a single-page format, an exception is returned.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Scale( ratio: int )                                                                                                                                            | Scales a page (or all pages) of a document or a batch relative to the basic value of 100.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| SplitHorizontal( pos: int )                                                                                                                                    | Splits a page (or all pages) of a document or a batch horizontally.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| SplitVertical( pos: int )                                                                                                                                      | Splits a page (or all pages) of a document or a batch vertically.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| SuitabilityForOCR: float                                                                                                                                       | Shows how suitable an image is for OCR. Possible values are from 0.0 to 1.0.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |

## Properties

| **Name**                             | **Type**                                                                                                                                                                                                                                    | **Access** | **Description**                                                                                                                                                                                          |
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Attachments                          | [IAttachments](/flexi-capture/scanning-station/shared/scripts/attachments)                                                                                                                                                                  | Read-only  | Attachments                                                                                                                                                                                              |
| BatchInfo (DocumentInfo or PageInfo) | [IBatchInfo](/flexi-capture/scanning-station/shared/scripts/batch-info) / [IDocumentInfo](/flexi-capture/scanning-station/shared/scripts/document-info) / [IExportPageInfo](/flexi-capture/scanning-station/shared/scripts/exportpage-info) | Read-only  | Item properties. If the requested property does not correspond to the item type, the **IsBatch** (**IsDocument** or **IsPage**) check is performed.                                                      |
| Children                             | [IWorkspaceItems](/flexi-capture/scanning-station/shared/scripts/workspace-items)                                                                                                                                                           | Read-only  | Child items                                                                                                                                                                                              |
| IsBatch (IsDocument or IsPage)       | bool                                                                                                                                                                                                                                        | Read-only  | Specifies whether the item is a batch, a document or a page                                                                                                                                              |
| IsExported                           | bool                                                                                                                                                                                                                                        | Read/write | Specifies whether the item is exported. Can be modified only for batch items in pre-export scripts.                                                                                                      |
| IsSelected                           | bool                                                                                                                                                                                                                                        | Read/write | Specifies whether the item is selected. Changing this property value for a particular item does not affect other items. Does not work if the current selection consists of elements of a different type. |
| Index                                | int                                                                                                                                                                                                                                         | Read-only  | The item index in the parent collection                                                                                                                                                                  |
| Name                                 | string                                                                                                                                                                                                                                      | Read/write | The item name. **Note:** If IWorkspaceItem represents a page, this property is read-only.                                                                                                                |
| Next                                 | IWorkspaceItem                                                                                                                                                                                                                              | Read-only  | The next item                                                                                                                                                                                            |
| Parent                               | IWorkspaceItem                                                                                                                                                                                                                              | Read-only  | The parent item                                                                                                                                                                                          |
| Prev                                 | IWorkspaceItem                                                                                                                                                                                                                              | Read-only  | The previous item                                                                                                                                                                                        |
| ScriptProperties                     | [IScriptProperties](/flexi-capture/scanning-station/shared/scripts/script-properties)                                                                                                                                                       | Read-only  | Script properties                                                                                                                                                                                        |

## Examples

### Apply an enhancement profile

An example of a script that applies the **Photo** enhancement profile to all images of the "photo" type:

```csharp theme={null}
foreach (IWorkspaceItem item in Workspace.Selection)
{
    if (item.PageInfo.IsPhoto)
    {
        item.ApplyPageProfile("Photo");
    }
}
```

### Remove stamps from part of an image

An event handler that removes blue stamps from the left half of all images in the selection:

```csharp theme={null}
foreach (IWorkspaceItem item in Workspace.Selection)
{
    if (item.IsPage && item.PageInfo.IsColor)
    {
        IPageRect rect = Workspace.NewPageRect();
        rect.Left = 0;
        rect.Right = item.PageInfo.Width / 2;
        rect.Top = 0;
        rect.Bottom = item.PageInfo.Height;
        item.RemoveStamps("blue", rect);
    }
}
```

### Remove stamps of specific colors

A script that deletes red and green stamps and marks from all document pages:

```csharp theme={null}
foreach (IWorkspaceItem item in Workspace.Selection)
{
    if (item.PageInfo.IsColor)
    {
        item.RemoveStampsExt("Red,Green");
    }
}
```
