The best option for creating pdf file or report,I suggest only
Dompdf.The Dompdf is fullfill all requirement.In Dompdf you have to
create simple pdf file,dynamic data file,generate database related pdf
file.
dompdf is an HTML to PDF converter. At its heart,
dompdf is (mostly) CSS 2.1 compliant HTML layout and rendering engine written in PHP.dompdf is an HTML to PDF converter
.
Download Dompdf :
- Link 1
- Link 2
- Link 3
Example For Create PDF :
$html = ("<html>");
$html .= ("<head>");
$html .= ("<style>");
$html .= ("</style>");
$html .= ("</head>");
$html .= ("<body>");
$html.=("<table width='500' border='1' cellspacing='1' cellpadding='1'>\n");
$html .= ("<tr>");
$html .= ("<td>hello</td>");
$html .= ("<td>welcome</td>");
$html .= ("</tr>");
$html .= ("</table>");
$html .= ("<h2>Generated PDF</h2>\n");
$html .= ("<p>date_today</p>\n");
$html .= ("</div>");
$html .= ("<p>$table->COMMENT</p>\n");
$html .= ("</body>");
$html .= ("</html>");
function render($html,$filename)
{
require_once("../dompdf_config.inc.php");
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->set_paper("a4", "landscape" );
$dompdf->render();
$dompdf->stream("$filename.pdf");
}
$filename = ("GeneratedPDF");
render($html,$filename);
}