Content Separation

Question:

I need to process a page that contains 3 tables. Is there a way to export each table into a separate CSV file?

Answer:

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

Was this article helpful?

1 out of 1 found this helpful

Have more questions? Submit a request

Recently viewed