How to replace text after recognition with c#?

  • 2K Views
  • Last Post 26 December 2014
Fernando posted this 26 December 2014

Hi,

I need to replace a text in a block after recognition, but I do not how to create a new Text object and assign to a Paragraph. I am using c#.

document.Pages.Layout.Blocks[j].GetAsTextBlock().Text.Paragraphs[0].InsertText(0, text)

how can I create a new "text" object?

Thanks in advance, Fernando

Order By: Standard | Newest | Votes
Julia Anikushina posted this 26 December 2014

Please find below a code snippet which shows how to insert a string into the text of the paragraph.

document.Process( null );
FREngine.LayoutBlocks blocks = document.Pages.Item(i).Layout.Blocks;
FREngine.ITextBlock textBlock = blocks.Item(j).GetAsTextBlock();
textBlock.Text.Paragraphs.Item(0).Insert(0, @"NewString", null);
document.Synthesize(null);

We would like to note that you should call the Synthesize method after inserting the text in order the new string appear in the result file.

Fernando posted this 26 December 2014

Great!!! It works OK. Thank you very much Julia for your response.

Fernando posted this 26 December 2014

It is OK!!! Thank you very much Julia for your help. Great!!!

Close