Add Signature to PDF using PDF Editor Web API
PDF.co offers an easy way to add or stamp signatures to your document. You can do this using the PDF Editor Web API. Check out our beginner-friendly Python demo below.
In this demonstration, we will add a signature to the PDF using the /v1/pdf/edit/add
endpoint. We will use the JPEG of John Doe’s signature. If you don’t have an image or a drawn signature, you can use our Make a Signature tool.
Step 1: Add Source File
First, add your sample source file to the python program. You can also use the given sample file and download the python code at our documentation.
Step 2: Install Requests Module
Next, kindly install the request module. Then, run the python -m pip install requests
in your command line to access the requests module.
Step 3: Input API Key
Now, open the Python sample code and add the PDF.co API Key. You can get your API Key in your PDF.co dashboard.
Step 4: Source File, Output, and Image Param
- In line 13, enter your source file URL. You can also use the given sample file.
- In line 25, type in the desired output PDF file name.
- In line 31, enter the image URL. You can upload your file at our file storage to get the URL for use in PDF.co.
Step 5: Run the Program
Now, run the python program and see the output in your folder.
In this tutorial, you learned how to add a signature to PDF in Python. You learned how to use the PDF.co PDF Editor Web API to add the signature in PDF. You also learned how to install the requests module.