I am doing a website using php , i need create a pdf doc from html page and attach that pdf doc in email. i have tried dompdf , but it didn’t works , it won’t shows the checkboxes and images, I am attaching my html page
The form contains a lot of checkboxes, selectionbox ,textarea, images. Is their any way to create the pdf doc ? I don’t want to change the form just need to convert it to pdf. Please help.
Dompdf
$html=$this->load->view('controller/viewfile', $data, true);
$this->load->helper(array('dompdf','file'));
pdf_create($html, 'designdaytona.com');
$data = pdf_create($html, '', false);
write_file('name', $data);
dompdf helper
if (!defined('BASEPATH')) exit('No direct script access allowed');
function pdf_create($html, $filename='', $stream=TRUE)
{
require_once("dompdf/dompdf_config.inc.php");
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
if ($stream) {
$dompdf->stream($filename.".pdf");
} else {
return $dompdf->output();
}
/*$var=$dompdf->get_canvas();
$var->new_page('bonjour', '2');*/
}
why don’t you try tcpdf library i found it very useful.
You can create form inside pdf take a look at http://www.tcpdf.org/examples/example_014.pdf