Hello.
I want to obtain the value of the checkmark, but I could not get it with the attached file and code.
Where is wrong?
Code
// Engine Load...
document = engine.CreateFRDocument();
document.AddImageFile(strImagePath, null, null);
FREngine.FRPages pages = document.Pages;
FREngine.FRPage page = pages.Item(0);
FREngine.Layout layout = page.Layout;
FREngine.Region region = engine.CreateRegion();
region.AddRect(687, 558, 744, 608);
// Create a new block
FREngine.IBlock newBlock = layout.Blocks.AddNew(FREngine.BlockTypeEnum.BT_Checkmark, region, layout.Blocks.Count);
FREngine.CheckmarkBlock checkMarkBlock = newBlock.GetAsCheckmarkBlock();
checkMarkBlock.CheckmarkType = CheckmarkTypeEnum.CMT_Square;
checkMarkBlock.IsCorrectionEnabled = true;
// Set Layout
page.Layout = layout;
document.Pages.DeleteAt(0);
document.AddPage(page);
// Process
document.Recognize(null, null);
document.Synthesize(null);
// PDF Export
FREngine.PDFExportParams pdfParams = engine.CreatePDFExportParams();
pdfParams.Scenario = FREngine.PDFExportScenarioEnum.PES_Balanced;
document.Export(strPDFPath, FREngine.FileExportFormatEnum.FEF_PDF, pdfParams);
document.Close();
document = null;
// Engine Unload...
Comments
4 comments
Hello!
You may obtain the value of the checkmark after the Recognition stage using the CheckmarkState property of the CheckmarkBlock.
Please, see the following code snippet:
You may also find the information in the Developer`s Help: Guided Tour→Advanced Techniques→Recognizing Checkmarks
Hope the information will be helpful!
Hello.
Thank you for your reply.
I tried the sample code, but in the attached file the block Item of layout becomes 0 Counts.
Is it not recognized by FRE in the attached file?
Checkmark block must be added to the document layout manually. You may do it with the code snippet from the first message. And then to get the value after recognition you should use the code snippet from the second post.
So the full code sample:
Thank you for answering.
I'm sorry, I missed the notation of "your code".
Check mark value was acquired with Sample Code.
It was very helpful.
Please sign in to leave a comment.