Dear all,

 

I want to detect a checkmark in a document.

 

With the code below, the check mark is always checked

 

I need a suggestion

 

Can you help me ?

Many thanks ;-)

public boolean isCheckmarkRGPDChecked(int numeroPage) {

             System.out.println("debug isCheckmarkRGPDChecked()");       

             boolean checkMarkChecked = false;

             document.getPages();

             IFRPage page   = document.getPages().getElement(numeroPage);

             //récupere le layout

             ILayout layout = page.getLayout();

             IRegion region = engine.CreateRegion();

             //left, top, right, bottom

//           region.AddRect(624, 673, 420, 469);

             region.AddRect(616, 329, 650, 355);

             IBlock block = layout.getBlocks().AddNew(BlockTypeEnum.BT_Checkmark, region, layout.getBlocks().getCount());

             ICheckmarkBlock checkMark =block.GetAsCheckmarkBlock();

             IIntsCollection blockIndices = engine.CreateIntsCollection();

             blockIndices.Add(0);

             page.RecognizeBlocks(blockIndices, null, null);

             System.out.println("Checkmark : " + checkMark.getCheckmarkState().toString());

             if(checkMark.getCheckmarkState().equals(CheckmarkCheckStateEnum.CMCS_Checked))

             {
                    checkMarkChecked = true;
             }

             System.out.println("fin isCheckmarkRGPDChecked()");

             return checkMarkChecked;

       }