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.
Add Signature to PDF
- Add Source File
- Install Requests Module
- Input API Key
- Source File, Output, and Image Param
- Run the Program
- PDF Editor Web API Demo
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 here.

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 here.
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 dashboard here.
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 here to get the URL for use in PDF.co.
Step 5: Run the Program
Now, let’s run the python program and see the output in your folder.
Result
Step 6: PDF Editor Web API Demo
Here is the PDF Editor Web API in action.

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.