Search

Add Signature Field to PDF


This blog will tell how to convert any pdf to a digital signature. In COVID-19 you may end up a situation where you want to send the invoice to your customer but there is legal or compliance requirement that your PDF should be either digitally signed or hand signature


Now you can imagine in lockdown how difficult it could be to take a printout, sign it, and the courier/scan it to your customer this could be really a mess.


In today's blog we can show how the PDFiddler platform can help us to solve this without the headache of printing, scanning, and courier it. The best part of this solution will work with any type of pdf from any source.



Step 1 - Open PDFfiller platform.

Step 2 - Upload the pdf Document where we want to add the digital signature option ( refer below screenshot )



Step 3 - Draw the region in the pdf where we want to add the digital signature option ( please make sure when save the region its use the same name which mentions in script )




Step 4 Copy N paste the below script

doc = load($input[0])
p = doc.getPage(1)

p.addText("Signer :",$signername) //optional if you want to add signer name

p.addField(SignatureField("signature").region($signbox))

output(doc)





Download and open the output file in Adobe Acrobat ( free tool), its give you the option to sign the PDF ( just click on the signature box and adobe will guide you how to add signature )


In the end, I want to cover how powerful scripting language helps some additional use cases with little change in the script.


Assume we want to add the two signature box once for the customer and another seller, just little draw one more region and little change in the script


doc = load($input[0])
p = doc.getPage(1)

p.addText("Seller :",$signername)

p.addField(SignatureField("signature").region($signbox))

p.addText("Receiver :",$signername)

p.addField(SignatureField("signature").region($receiversignbox))

output(doc)



Output of the above script




let make it more complex, I didn't like the word "Receiver", I want to add the real name of the customer whose name was printed on the invoice.


You have to click on the buyer name inside the PDF ( by simply clicking, it will draw the region around that text). In our case its "john Smith"

Save the region with "receivername"



Copy n paste the below script ( which very similar to above just little more line to extract customer name )


doc = load($input[0])
p = doc.getPage(1)

name = p.extractText($receivername)
p.addText("Seller :",$signername)

p.addField(SignatureField("signature").region($signbox))

p.addText(name +":",$reciever)

p.addField(SignatureField("signature").region($receiversignbox))

output(doc)


Here the final output document




The best part is you have to do all these steps once and it works all similar type of pdf we need don't have to repeat it again n again. Just you have to upload the new pdf document or upload multiple documents at once


Conclusion

We make it easy for people to automate the process. If you need help to connect your apps or have an API that you want to drop us a mail at [email protected] or comment on twitter

PDFFiddler is the leading technology platform for generating and manipulating files in the Portable Document Format (PDF). Its mission is to develop an open marketplace for PDF related products and services.

  • White LinkedIn Icon
  • White Facebook Icon
  • White Twitter Icon
  • White YouTube Icon

© 2020 by PDFFiddler