12 August 2016
- Last edited 15 August 2016
In ABBYY FlexiCapture Engine API, Field objects provide the IField::Blocks property that stores the collection of blocks which correspond to the given field. Depending on the document definition, several blocks may correspond to a single field.
Block objects have the IBlock::Region property that provides access to the block region - an area of the page that the block occupies or, in other words, its location. Once you have the necessary Region objects (one or several), you can use them to save the corresponding parts of the page image to image files.
To save a part of a page image, you should first obtain the corresponding ImageDocument object (the IPage::Image property), and then one of its image plane Image objects - either color or black-and-white (properties IImageDocument::ColorImage and IImageDocument::BlackWhiteImage).
Image objects provide the IImage::WriteToFile() method. By default, this method saves the whole image of the page; to save a part of the page, create an ImageModification object, assign the Region object obtained earlier as the value of the IImageModification::ClipRegion property, and pass the resulting ImageModification object to the WriteToFile() method as one of its parameters.
If you follow these steps, you should be able to achieve the desired results. Please refer to the Help file articles API Reference→Objects→Document Structure→Field and API Reference→Objects→Image-Related Objects→Image for additional information.