I used many solutions, including DOMPDF, but on average the output generated by WKHTMKTOPDF is far better than DOMPDF.
WKHTMKTOPDF follow CSS rules more precisely.
Well, wkhtmltopdf is a command line program that accepts an html file as parameter, so you just have to install it and you are ready to go. It has package for Linux and Windows.
To the code
Generate the desired html from your view, like this:
I used many solutions, including DOMPDF, but on average the output generated by WKHTMKTOPDF is far better than DOMPDF.
WKHTMKTOPDF follow CSS rules more precisely.
Well, wkhtmltopdf is a command line program that accepts an html file as parameter, so you just have to install it and you are ready to go. It has package for Linux and Windows.
To the code
Generate the desired html from your view, like this:
Write the HTML to a temporary file:
Run exec() on wkhtmltopdf:
Download your
$pdf_file
.Be happy.