Is there a way to check if there's a signature on the document?


Is there a way to check if there's a signature on the document?


There are no built-in methods specifically implemented for signature detection, but there's an approach that can be used to detect if the signature present on the document.

  1. Create a FlexiLayout, marking keywords that later can be used to precisely limit the area with the signature using the Region element.  

  2. Map these regions to checkmark blocks.
  3. mceclip0.png
  4. Export the FlexiLayout into a ".afl" file File > Export.
  5. Create a document definition based on created FlexiLayout in the FlexiCapture project (or add it as an additional layout to an existing document definition).
    Creating a Document Definition based on a FlexiLayout
  6. Create a script rule for each signature (checkmark). The script takes into account the number of filled dots in the area (blackness percentage) to set the value of the checkmark.

int threshold = 1;
IPictureObjectsInfo PictureObjectsInfo = Context.Field("Signature_M").Regions[0].Picture.AnalyzePageOjects(null);
Context.Field("Signature_M").Value = PictureObjectsInfo.BlacknessPercentage < threshold ? false : true;

The threshold value determines the percentage of the area that needs to be filled with the dots (1% in the example) and sets the value of the checkmark to a "checked" state if this value is exceeded and leaves it unchecked otherwise. This value depends on the documents and signatures that are processed and additional adjustments may be needed for the best results after the tests.

Here are the results of the tests:

The downside of this method is that if scanned documents are of bad quality or the quality varies greatly between the samples (e.g. there are scanning marks in the signature area), this approach may not work correctly.

Have more questions? Submit a request



Please sign in to leave a comment.