Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function gerar() {
- $this->load->helper('funcoes_helper');
- $this->load->helper('financeiro_helper');
- $this->load->helper('array_helper');
- $this->load->model('cadastro_model');
- $this->load->helper('funcoes');
- //load the view and saved it into $html variable
- $html= $this->load->view('novo/contrato', true);
- //this the the PDF filename that user will get to download
- $pdfFilePath = "contrato.pdf";
- $mpdf =$this->load->library('m_pdf','m_pdf');
- //load mPDF library
- $this->load->library('m_pdf','m_pdf');
- $mpdf->pdf->SetTitle('My Title');
- //generate the PDF from the given html
- $this->m_pdf->pdf->WriteHTML($html);
- //download it.
- $this->m_pdf->pdf->Output($pdfFilePath,'I');
- }
- include_once APPPATH.'/third_party/mpdf/mpdf.php';
- class M_pdf {
- public $param;
- public $pdf;
- public function __construct($param = "'c', 'A4-L'")
- {
- $this->param =$param;
- $this->pdf = new mPDF($this->param);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement