I am using the following code to convert html to pdf. But the resulting pdf page shows blank. Please help me...its very urgent..

$str =stripslashes('<div style="width:580px;" align="left">'.$pdfmessage."</div>");
$pdf=new HTML2FPDF();
$pdf=new HTML2FPDF();
$fp = fopen("sample.html","r");
$strContent = fread($fp, filesize("sample.html"));
echo "PDF file is generated successfully!";

i was using this http://html2pdf.fr/ it is very simple and good ...works for me...
it have more the 15 examples inside so ...easy to understand and to work with...


I used it...but the pdf document is blank...Any rules for the html page tags?

There are some tags that it doesn't like (e.g. <center>, <tt>,<title>,<meta>,<outline>) and the rest must be closed where possible. As an example, if you create a table and use <tr> or <td> without closing </tr> or </td> tags, it won't work. It may look fine as HTML but you can't take shortcuts when using this utility. If you give it good input, it works great.

this is best code i catch form here..