Esempio n. 1
0
 /**
  * Return a response with the PDF to show in the browser
  *
  * @param string $filename
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function stream($filename = 'document.pdf')
 {
     if ($this->html) {
         $this->mpdf->WriteHTML($this->html);
     } elseif ($this->file) {
         $this->mpdf->WriteHTML($this->file);
     }
     return $this->mpdf->Output($filename, 'I');
 }
Esempio n. 2
0
 public function toObject()
 {
     return '<object type="application/pdf" data="data:application/pdf;base64,' . base64_encode($this->mpdf->Output('', 'S')) . '" width="100%" height="100%"></object>';
 }
Esempio n. 3
-51
 function print_animal_report()
 {
     $animal_service = new Animal_service();
     $data['heading'] = "Manage Animals";
     $data['results'] = $animal_service->get_animals();
     $print_out = $this->load->view('animal/animal_rep_print', $data, TRUE);
     $footer = $this->load->view('template/custom/pdf_footer', $data, TRUE);
     $this->load->library('MPDF56/mpdf');
     $mpdf = new Mpdf('utf-8', 'A4');
     $mpdf->SetDisplayMode('fullpage');
     $mpdf->SetFooter($footer);
     $mpdf->WriteHTML($print_out);
     $mpdf->Output();
 }