HTML 2 PDF via PHP

Found the new way of converting HTML/CSS code to PDF.

Download the mPDF library and extract to the root directory, create the index.php file:
Пример 1Пример 2Пример 3Пример 4 Пример 5Пример 6Пример 7mPDF‘;

include(“mpdf50/mpdf.php”);

$mpdf = new mPDF(‘utf-8’, ‘A4’, ‘8’, ”, 10, 10, 7, 7, 10, 10); /*задаем формат, отступы и.т.д.*/
$mpdf->charset_in = ‘cp1251’; /*не забываем про русский*/

$stylesheet = file_get_contents(‘style.css’); /*подключаем css*/
$mpdf->WriteHTML($stylesheet, 1);

$mpdf->list_indent_first_level = 0;
$mpdf->WriteHTML($html, 2); /*формируем pdf*/
$mpdf->Output(‘mpdf.pdf’, ‘I’);
?>

CSS code example:
table {text-align: center;font-size: 20pt;width: 100%;}

And that’s all.

http://mpdf.bpm1.com/