How to check if there is a signature on several PDF

Hi all,

I would like to identify the presence of a signature on several documents.
What should I use? The “Image Exists” seems not working properly.
I’ve made the following example on Tick boxes :negative_squared_cross_mark: : Main.xaml (16.2 KB)

I’ve done the exercice on 4 documents, 2 documents have a Tick box and 2 documents without. However, “Image exists” identify only 1 document with a Tick box.

Hi @palaniyappan do you have an idea?

1 Like

Fine, actually what you were trying is correct…hmmm
may i know how that signature looks and at what page we can see it
kindly share a screenshot if possible that could help us
Cheers @Lili1

Thank you so much for helping me!
Everythime, this is the first page where we can see it.
Here are the documents:

  1. Signature

  2. Tick boxes

Fine
image exists should actually work, the reason is the pdf may not opened fully to check for the image
–use start process and pass the file path of the pdf as input under file property
–use a maximize window activity to maximize the application
–next to this use a image exists activity and check whether image is there or not
–then we can use the above boolean output to check whether its there or not

hope this would help you
kindly try this and let know for any queries or clarification
Cheers @Lili1

1 Like

I’m assuming the pdf is a scanned pixelated document.

So, you need to find the signature box first. This is the tricky part. I suggest getting your xaml to scroll the document using PgDwn key or PgUp if you start at the bottom, for example. And, you will need to scroll every page until you find it.

Then, use Find Image to find text near the signature box, such as the “Signature” part or some part of that text. You will need to play around with the Zoom of the document and Accuracy of the Find Image until it is consistent. Note: your xaml should set the Zoom each time.

Once you store that to an element variable from the Find Image, you use the Set Clipping Region (there are examples of that on the forum). This will set a new element box around the signature box; use the Highlight activity until you know your new clipping region is good.

The previous steps are the hard part.

The last part is just applying Get OCR Text inside the element variable. Then, check if it equals certain characters. Like "",",","/"``` and other characters would probably be an invalid signature.

Another thing you can do is take a screenshot inside the element and paste the image into a sized cell in Excel (fit to cell), so it is provide for a second validation if necessary; or they can also look at the document instead of adding an image, but it’s just another cool idea.

So in summary:

  • Zoom document
  • Scroll Document inside a loop until Find Image isNot Nothing
  • Set Clipping Region, Highlight
  • Get OCR Text of element
  • Check string if it has invalid characters

It’s a little tricky though.

Regards.

3 Likes

Thank you very much for all these information and tips.
I’ll try them and let you know how it turns out :slight_smile:

1 Like

Great
Cheers @Lili1

Hi Lili - Did this suggestion work ? If so do you mind sharing your feedback/xaml file ? I am struggling with similar problem where I need to find out if a PDF has been signed or not

Hey @Rahul_Mathur, did you ever find a solution, please help if you did

If this helps, in my use case I did the following:

  • Take screenshot of the signature input (in case there is one) and save it.
  • Initialize a Bitmap Reader using the path of the image saved.
  • Loop over the pixels of the image and then add the color name identified by x,y position to a HashSet.
  • I had a threshold to control the number of distinct colors identified in the image. If it was above the threshold, it meant to the bot that the signature was present.

Note: my check was to simply verify whether there was something in the box or not. If you need a more complex validation, this may not be the answer you are looking for.

2 Likes

Hi all,

There is an easy way to check that, you can include Intelligent OCR activities in your project, I have been working with that obtaining good results.

Here’s a tutorial about how to build your sequence.

Regards,

Andres

1 Like