Cannot modify the page image

  • 669 Views
  • Last Post 06 August 2015
  • Topic Is Solved
Kreol posted this 04 August 2015

Hi, I'm using ABBY SDK 10-0-9-89.

I'm trying to Analyze the page and then transform it and analyze again:

page.Analyze(pageProcessingParams);
page.ImageDocument.Transform(RotationTypeEnum.RT_Clockwise, false, false);
page.Analyze(pageProcessingParams);

But transformation crashes with exception:

System.Runtime.InteropServices.COMException: Cannot modify the page image. Remove all blocks and separators from the page layout and try again. at FREngine.IImageDocument.Transform(RotationTypeEnum Rotation, Boolean Mirror, Boolean Invert)

And I do not do anything else just loaded document and trying to perform those operations on a page. Any ideas please what's wrong and how it can be worked around?

Order By: Standard | Newest | Votes
Oksana Serdyuk posted this 05 August 2015

The issue occurs because the page layout is not empty and to use the IImageDocument::Transform method you should firstly remove all blocks from the page layout. To do it, call the ILayoutBlocks::RemoveAll method for each of the ILayout::Blocks, ILayout::BlackSeparators, ILayout::VisualBlocks collections of the corresponding layout. The fact is that during the first call of the IFRPage::Analyze method ABBYY FineReader Engine has already detected some certain blocks and put them to the Layout object for your page.

Kreol posted this 05 August 2015

Thanks Oksana, now I can see some sense in this behavior. But still suggested solution does not work. Now I'm trying this:

page.Analyze(pageProcessingParams);

page.Layout.BlackSeparators.RemoveAll();

page.Layout.Blocks.RemoveAll();

page.Layout.VisualBlocks.RemoveAll();

page.ImageDocument.Transform(RotationTypeEnum.RT_Clockwise, false, false);

page.Analyze(pageProcessingParams);

And still getting the same exception.

Oksana Serdyuk posted this 05 August 2015

I have reproduced the issue using FineReader Engine 10. I will forward this information to the developers and will create the corresponding reclamation. Hope that the fix will be available in next release of the program.

This issue is already fixed in FineReader Engine 11. Could you please contact your sales manager to upgrade the program up to the current version? Or you can send your serial number to SDK_Support@abbyy.com and we will send your request to your region sales manager.

Kreol posted this 06 August 2015

Thank you Oksana for your investigation and help! I'll try to upgrade the library.

Close