Creating PDF Document using DomPDF

<?php
/**
* Convert the HTML into a PDF and store it in a particular location.
* In this example, the dompdf library is stored under libraries folder in Drupal.
*/
function ji_custom_convert_pdf($user_html){
 
//Get path of dompdf folder under libraries
 
set_include_path(libraries_get_path('dompdf'));
  require_once
"dompdf_config.inc.php";
 
$dompdf = new DOMPDF();
 
$dompdf->load_html($user_html);
 
$dompdf->render();
 
$output = $dompdf->output();
 
file_put_contents("sites/default/files/resume/".$user->name."_resume.pdf", $output);
}
?>

--
Download latest dompdf: https://code.google.com/p/dompdf/downloads/list