Sign a PDF document with JavaScript and PHPSign a PDF document with JavaScript and PHP
This script allows your users to review and sign a PDF document, such as a contract, invoice, bill, ... Average rating of 4.3 based on 4 votesSign a PDF document with JavaScript and PHP
This script allows your users to review and sign a PDF document, such as a contract, invoice, bil... Average rating of 4.3Overview
This script allows your users to review and sign a PDF document, such as a contract, invoice, bill, ...
First, it will display a pdf file from your server, whether it contains only one, or several pages.
Then, the script will automatically look for a string of text, such as "Signature" to identity where the signature should be placed on the document, and adds a "Sign the contract" button at this position, in addition to the button in the fixed navbar at the bottom of the screen.
When your user clicks one of these two buttons, a drawing pad is displayed and your user can either draw with their mouse, or their finger, if they see the document from a smartphone/tablet (yes, the whole script is responsive and mobile friendly!).
Alternatively, they can also write their name and select the font they want to use for their name. Adding more fonts and/or removing the included ones is easy and I explain how to do so.
The script validates different points and either returns an error if something happened, or if your user have tricked the code (ahhhhhh!!!), or will generate the signed PDF and redirect to a confirmation page, that offers a link to download a copy of the PDF.
When your user confirm their signature, a new PDF is generated PDF, their signature and a signing date is added, to the template, as well as an additional page at the end of the file, with some details about the contract and a history of the signing process, plus your logo at the bottom of this additional page. The idea being to help you to see a working example of how to do that, if you don't need this, of course, you will remove that part of the code.
The code is kept as simple as possible while being quite complete, the idea is for you to be able to customize it easily to fit your own needs and adjust it to your own branding etc.
Expect a clean code, with a html file, a little css file (bootstrap 5 is loaded, and does most of the styling/reponsive job), a javascript file, as well as a php file to generate the signed pdf file.
All the librairies used in the script are included using composer.
I'm already sure that you will quickly feel at ease to modify this code, and to save you even more time, I added a "Read me" file with some helpful tips to modify the code and do your thing.
Enjoy the time you saved, and have a good day!
Features
- Display a .pdf document
- Your user can sign the document, by drawing their signature or writing their name with a font of their choice
- A new file is created with the added signature as well as an additional page with the signing history
Requirements
- A PHP server
- You need to be a JavaScript and PHP developer!
Instructions
Everything is explained in a "Read me.txt" file provided along with the code.
Reviews
-
7 months agoanicetyo1977 PurchasedRating:
-
9 months agoishuflac PurchasedRating:
-
Oct 9, 2023matejtu PurchasedRating:Today after months from my purchase i have finally installed the script. I can say is works flawlessly. NOT A SINGLE ISSUE!! The code is well structutred and readable so that few changes that you will maybe need will not be an issue. GREAT JOB!!! Thank you to the developer. He/She saved me a lot of time. A++++++
-
Sep 6, 2023
Other items by this author
Category | Scripts & Code / JavaScript / Miscellaneous |
First release | 4 March 2023 |
Last update | 13 March 2023 |
Software version | PHP 7.0, PHP 7.1, PHP 7.2, PHP 7.3, PHP 7.4, PHP 8.0, PHP 5.x, PHP 5.4, PHP 5.5, PHP 5.6 |
Files included | .php, .css, .html, Javascript .js |
Tags | php, Javascript, invoice, document, sign, pdf, signature, contract, e-signature, signing, esign, numeric signature, e-sign |