Quick suggestion - you should integrate the functions to extract signature data inside PDF. This is a huge issue and everyone has to write their own.
for example, this is my sample piece of code to extract data from Aadhaar signed PDF https://pastebin.com/dg8p98T1