1

I am using following code to generate PDf from HTML I have but I am not getting the background color as is in HTML provided. I get a white background.

$content = "
<html>
<body bgcolor='#E6E45A'>
<h1>Hello world!</h1>
</body>
</html>";
require_once('html2pdf_v4.03/html2pdf.class.php');
try
{
$html2pdf = new HTML2PDF('P', 'A4', 'fr');
$html2pdf->writeHTML($content, isset($_GET['vuehtml']));
$html2pdf->Output('exemple01.pdf','D');
}
catch(HTML2PDF_exception $e) {
echo $e;
exit;
}
How can this be achieved in html2pdf that I am using.
Cheers!

2

do not use html and body tag. look at the examples

do not use bgcolor, it is very old. use CSS styles
Ancien pseudo : lolo