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.
- Create a FlexiLayout, marking keywords that later can be used to precisely limit the area with the signature using the Region element.
- Map these regions to checkmark blocks.
- Export the FlexiLayout into a ".afl" file File > Export.
- 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
- 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.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.