<?php

require_once('html2pdf/html2pdf.class.php');

$html2pdf = new HTML2PDF('P', 'A4', 'fr'); //HTML2PDF object created

$content = '<html>'
        . '<body>'
        . '<h1>Test Heading</h1>'
        . '<p>This is test html body</p>'
        . '<p style="color: blue;">This is test html body</p>'
        . '<p style="background-color: orange;">This is test html body</p>'
        . '</body>'
        . '</html>';

$html2pdf->WriteHTML($content); //processing html and perform conversion
$filename = 'test.pdf';
$html2pdf->Output($filename);
