In a php project sometimes we need to do php html to pdf.There a lots of technique to php html to pdf.In my blog i already describe a technique a technique that is mpdf.Here i describe another way with using another dependency.That is snappy,which is developed based on wkhtml to pdf.So now we learn how to made a php html to pdf file.At first for this we need to require this dependency in our cmposer.json file and also require wkhtmltopdf-amd64.Lets see how to require this
Require PHP HTML to PDF Dependency
Here i gave you Packagist URL
And also Github URL
After require run composer update from terminal to download that package in your project’s vendor file.If you are not using composer just download that packagist from github and keep them with your project.
You found this package in your directory like this
After that follow my below code.There are many way to made html to pdf.
One is made a html to pdf and save it in a directory.
Another is made a pdf through a url.
Another one is made a pdf and show it output and also can download it.
Lets see how to do that