PHP Classes

How Can PHP Create PDF with Digital Signature Automating the Process Using the signNow API

Recommend this page to a friend!
  Blog PHP Classes blog   RSS 1.0 feed RSS 2.0 feed   Blog How Can PHP Create PD...   Post a comment Post a comment   See comments See comments (0)   Trackbacks (0)  

Author:

Viewers: 350

Last month viewers: 50

Categories: PHP Tutorials, Sponsored

Many applications are written in PHP to develop systems that need to produce PDF documents.

Sometimes the PDF documents will be used as contracts or other documentation that must be signed by the people involved in a business or any agreement.

Changing the PDF documents to include the signatures of the people participating in the agreement is a complex process.

Fortunately, there are platforms like signNow that simplify that process by providing an easy-to-understand user interface to submit PDF documents and call the people that need to sign the documents in a way that the process is legally binding.

Please read this short article to learn how to use the signNow API from PHP to integrate the process of submitting PDF documents to the signNow platform and let the platform take care of the complexity of collecting signatures and generate legally binding documents that can be important for your company or the company of your PHP development customers.






Loaded Article

In this article you will learn about:

1. Why It May Be Important to Have Legally Binding Signatures in the PDF Contracts or Other Documents Generated By PHP Applications

2. What You Can Do to Include Signatures of People in PDF Documents Generated by Your PHP Applications

3. How to You Can Insert Signatures of People in Your PDF Documents Generated by Your PHP Application

4. How to Include People Signatures in the PDF Documents Your PHP Applications in a Faster and Easier Way

5. How You Can Try the signNow API for Free


1. Why It May Be Important to Have Legally Binding Signatures in the PDF Contracts or Other Documents Generated By PHP Applications

Many PHP applications generate PDF documents for their users that must be legally binding. This means that the documents need to contain evidence that the people mentioned in the documents agree with what is said.

For instance, if your PHP application generates PDF documents that are contracts between two companies, the contracts must contain the signatures of the people that represent those companies to be considered legally binding.

The signatures must also be recognized by a third-party entity that can confirm that the representative that people signed the contract is the person that claims to have the names, email addresses, and other aspects of their identity, like, for instance, their identity document numbers. 

2. What You Can Do to Include Signatures of People in PDF Documents Generated by Your PHP Applications

The signatures of the people that sign a PDF document must be captured somehow. The capture method can be, for instance, taking a picture of a signature on paper, scanning a report with the signature, or catching the drawing of the signs that the person does on a touch screen with a pen, in a mobile phone, tablet or computer with a touch screen.

Then the picture of the signature needs to be uploaded to the server where your PHP application is running.

Then you need to insert the picture on the PDF document in the places of the document where the signature is expected to appear.

3. How to You Can Insert Signatures of People in Your PDF Documents Generated by Your PHP Application

PHP had some extensions to generate PDF documents, but they are no longer maintained. Several PHP developers wrote pure PHP packages to create PDF documents.

Here you may find several recommendations for PHP packages that you can use to generate PDF documents.

Some solutions use the Chrome browser to generate PDF from HTML. Others use a package called  TCPDF that is made of pure PHP.

If you use the TCPDF library, you may try to use PHP code like the one below to create a document and insert an image of a signature read from a file.

$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('My name');
$pdf->SetTitle('Contract');
$pdf->SetSubject('Signed');

$pdf->AddPage();

$pdf->setJPEGQuality(75);
$x = 15;

$y = 140;

$width = 75;

$height = 113;

$pdf->Image('signature_image.jpg', $x, $y, $width, $height, 'JPG');

$pdf->Output('signed_document.pdf', 'I');

This is a simple example of inserting an image into a PDF document. Real applications would be more complex and would insert the image in the correct position, which is better for the people who read the contract.

4. How to Include People Signatures in the PDF Documents Your PHP Applications in a Faster and Easier Way

Still, the approach above to add signatures to PDF documents does not solve the problem of creating legally binding PDF documents with signatures.

The signatures need to be verified by a third-party entity confirming that the documents belong to the people who signed them document.

A more straightforward approach is to use a service like signNow that provides an API to take a PDF document in.

Then the signNow platform collects the signatures from the people who will sign the document using the signNow site or the signNow mobile applications.

As a developer, in theory, you could create a system like signNow. It would take a lot more time to develop and test to make it work like the signNow system.

The time it would take to develop such a system would cost you money because, during that time, you would need to pay for your food, rent, and other expenses to keep your life.

Therefore a solution like signNow is better because it is ready and can start using signNow API for free during the free trial period.

You can also use the API sandbox for free to test your API calls. More about the API sandbox is explained below in a video.

The signNow API provides all the functions you need to submit a PDF document to the platform and then set the position of the signature images that the platform will collect from the people who will sign the document.

Here are the steps that you need to follow to achieve the goal of submitting a document to the signNow platform using the signNow API from PHP or another language:

1. Get an OAuth 2 bearer token to access the platform

Here is a short video of how to do it in any language, including PHP. You will learn how to set up a sandbox account to test the signNow API for free.

2. Upload a PDF document file to the platform using the API endpoint URL https://api-eval.signnow.com/document . Here is a video explaining this API call to upload a PDF document file.

3. Add a field to the PDF document to specify the place in the document of the signature images where the people who sign the document will have their signature inserted by using the API endpoint URL https://api-eval.signnow.com/document/{document_id} .

Here is a tutorial video that explains in more detail the signNow API calls that you can use to add fields to the document that can be placeholders for the signature images or fields of other types, like, for instance, text inputs.

4. Create a signature invitation to invite the people you want to sign the document.

Here is a tutorial video with more details about the API calls you need to get sign invitation links.

You can try the signNow API examples without using a programming language just by going to signNow Postman workspace.

5. How You Can Try the signNow API for Free

As you may understand by now, making your application to set up documents to sign using signatures that the signNow platform collects from the signing people is much simpler. It takes much less time than doing it yourself in PHP or any other language.

We may provide specific articles with more PHP code examples in the future. For now, try the signNow API for free to evaluate it yourself.

How Can PHP Create PDF with Digital Signature Using the AirSlate API




You need to be a registered user or login to post a comment

1,615,374 PHP developers registered to the PHP Classes site.
Be One of Us!

Login Immediately with your account on:



Comments:

No comments were submitted yet.



  Blog PHP Classes blog   RSS 1.0 feed RSS 2.0 feed   Blog How Can PHP Create PD...   Post a comment Post a comment   See comments See comments (0)   Trackbacks (0)