How To Fill A Fillable PDF Form with PHP using PDFtk
Mr Digital Mr Digital
29.7K subscribers
35,095 views
0

 Published On Feb 13, 2020

How to fill a PDF using PHP?

Have you ever wanted to know how to grab data from a form on a website and have it fill an already existing fillable PDF? Maybe you have a PDF with a form in it that you want to be filled in from a web form, so that it keeps the look and feel of your PDF with the data. Of course, you can fill in the PDF using Adobe Reader but what if your website form did it instead?

Well, PDFtk, along with PHP can help you achieve just that.

You can clone the project repository from here: https://github.com/mrdigitalau/PHP-PD...

This simple video will show you how to do it. I'll be creating a simple project showing you how to fill PDFs on your website.
I will not be doing form validation so that is something you will want to do if you plan on sending the project live. Don't
forget to do front end and back end validation.

PDFtk is a free tool for PDF Manipulation, and there is also a PDFTK Server, which we can use with PHP to manipulate PDFs.

Many other PDF libraries do not fill PDFs or make it very difficult to do so, PDFtk with php-pdftk is very simple to use.

PDFTk does not only fill PDFs, it can join PDFs together, it can remove files and add files. It can split files, add overlays and even
grab data from a PDF to use in PHP. This tutorial will simply show you how to fill PDFs, but the php-pdftk library can be used for more things.

show more

Share/Embed