Hello,
I have to generate a PDF with TCPDF, my information come from my database, so I have to write PHP variables. I know how to do.
But I want to write CSS + xHTML (as an example I have seen of TCPDF site) using :
$html = <<<EOF
<style>
<!-- My CSS -->
</style>
<!-- My xHTML -->
EOF;
$pdf->writeHTML('$html', '');
I have errors when I try to open the PDF. I have read I must escape the '$' with '\'. After this, I have no error, but the content of my variables doesn't appear in my PDF.
EDIT :
@Sarfraz: I don't see how can I do this if I do this, it doesn't work ?
$html = <<<EOF
<style>
<!-- My CSS -->
</style>
<!-- My xHTML -->
<span><?php echo $myVar; ?></span>
EOF;
$pdf->writeHTML('$html', '');