Checkbox and signature on scanned pdf (any OCR engine in UiPath)

Hi, Is there a way to identify if checkbox is marked on scanned document ?
Maybe also a signature ? Have you met a similar problem ?

1 Like

Hello,
How pixelated is the document? You can try Find Image with low Accuracy and scroll through each page to see if you can find it… if not, then it’s not checked.

You can also try Find OCR Text with correct scale for accuracy near the check box, then use Set Clipping Region to adjust box to the check box to see if the image is correct or run OCR inside the adjusted clipping region to see the check is converted to a character.

My solution to detect a signature was to scroll through the bottom pages til I found a consistent image, then Set Clipping Region to the Signature Box and used Get OCR Text to convert the inside to characters. I then took those characters and created a condition to determine if it’s valid or not.

Clipping Region is set like this:
New UiPath.Core.Region(New Rectangle(elementSignature.ClippingRegion.Rectangle.Value.Left-67, elementSignature.ClippingRegion.Rectangle.Value.Top-138, elementSignature.ClippingRegion.Rectangle.Value.Width, elementSignature.ClippingRegion.Rectangle.Value.Height+83))

And, use the same element in a variable that you Set Clipping Region on for the OCR Engine.
I also needed to use a dynamic OCR Scale since the Signature is different sizes by incrementing it with a variable if the OCR fails.

Well, hope this helps!

Thanks.

6 Likes

Hey ClaytonM … I want to check scanned pdf documents (contracts) if the customer has generally signed them OR not. It seems as if this post is exactly on this topic.

But I’m relatively new to UiPath. Can you add some details to the solution? I’m (for example) confused by the fact that you’re using the activities from the UI Automation package. What are you doing in the action within the retry scope?

Hi.

Are the documents consistent [for most part] on how the signature box is presented on the file(s) - size, position next to text, etc? I ask because ideally you would need to identify an image near the box to locate the area of the box, then create a region inside the box which includes only the signature area and nothing else.

Additionally, I would suggest collecting several examples of the documents, and identify some text near the signature box, such as “Please Sign Here” or something like that. Then, with UiPath, use ‘Find Image’ on that area while the file is open. Verify that the area can be identified like this consistently for every file example you have to test. some files could be more pixelated than others causing some inconsistencies. I believe this was the case with my project as well, in which case, I needed a variety of ‘Find Image’ activities to capture the inconsistencies.

If you think this will work well enough for your collection of documents, then I can provide more details on designing these steps to check if the signature is [generally] signed. However, due to lack of time, it might be a few days to a week.

Also, I may have these details in other topic threads as well, so feel free to search the forums further for my replies on this. Simply put, it involves opening the file, scrolling through the pages, finding the identifier image (“please sign here”), set clipping region using the found element, getting OCR text, then comparing the characters that was read from the signature region.

Thanks.

1 Like

Hi ClaytonM,
thank you very much for your fast reply on this very old ticket!

Unfortunately our docs are not forms. They consist of freeformed text from the customers. But in the lower 3rd we almost always a final sentence like “Mit freundlichen Grüßen” (i.e. best regards) and then normally comes the signature. For example:

I think that I can use this as an anchor for the image box.

Thank you again

1 Like