I need to process a page that contains 3 tables. Is there a way to export each table into a separate CSV file?
There are no CSV export settings that allow saving tables from a single document to separate CSV files. There is, however, a workaround we can recommend.
1. Analyze the document by calling the FRDocument::Analyze method(IPageProcessingParams).
2. Create the ImageModification object of the Image object (FRPage::ImageDocument::Image);
3. Make a cycle for every Layout Block in the FRPage of the FRDocument.
4. Inside this cycle, create an if statement with the type of the Layout Block. If the type of the Layout Block is BT_Table value (FRPage::ILayoutBlocks::IBlock::Type = BT_Table), complete steps 4.1-4.4.
4.1. Get the Region of this table Block (myRegion = ILayoutBlocks::IBlock::Region);
4.2. Call the ImageModification→ClearClipRegions() method;
4.3. Call the AddClipRegion method of the ImageModification object with the Region argument from step 4.2: ImageModification→AddClipRegion(myRegion);
4.4. Save the Image with the clipped region (table block) as a new file: Image→WriteToFile(newFileName, filFormat, ImageModification, 0);
5. After step 4 you will have several documents containing only one table each. This way you can open, analyze and recognize every document image and export it into a separate CSV file.
Please sign in to leave a comment.