I have a PHP file that generates a report from the database, and I want this page to be converted into a PDF file, so it can be saved and printed. How do I convert a web page to a PDF? Is there any tool available or a PHP script?
If you want generate PDF client-side (with a button on the html report), you could use jsPDF (http://parall.ax/products/jspdf)
You can use MPDF, a PHP library which generates PDF files from UTF-8 encoded HTML. It's under GNU GPL v2 licence.
https://mpdf.github.io/
https://github.com/mpdf/mpdf
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With