Download dompdf latest version from https://github.com/dompdf/dompdf and copy it to application/third_party folder
$this->load->view('yourviewpage_name');
$html = $this->output->get_output();
// Convert to PDF
$this->dompdf->load_html($html);
$this->dompdf->render();
$this->dompdf->stream("sample.pdf");