Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert a PHP web page to PDF? [closed]

Tags:

html

php

pdf

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?

like image 795
QKWS Avatar asked Aug 08 '13 06:08

QKWS


2 Answers

If you want generate PDF client-side (with a button on the html report), you could use jsPDF (http://parall.ax/products/jspdf)

like image 184
0xBAADF00D Avatar answered Oct 20 '22 15:10

0xBAADF00D


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

like image 37
Goutam Pal Avatar answered Oct 20 '22 16:10

Goutam Pal