script

Tuesday, January 24, 2012

Dompdf Version 0.6

1. Generate pdf


include_once("dompdf_config.inc.php");
$content = 'Test content!!';


$dompdf = new DOMPDF();
$dompdf->load_html($order_content);
$dompdf->render();
$outfile ="test.pdf";
//download pdf(Attachment will be false if you want to render in your browser)
$dompdf->stream($outfile, array("Attachment" => true));

//will save pdf
$pdf = $dompdf->output();
file_put_contents($outfile, $pdf);

No comments:

Post a Comment