Welcome Guest, Not a member yet? Register   Sign In
mpdf with dynamic data
#5

[eluser]fatangel26[/eluser]
- Array $data['reports'] have value ?. Check it. My code for export to pdf:
Code:
public function export2pdf()
        {
   $this->load->library('mpdf');
            $mpdf = new mPDF('utf-8');
  
   $mpdf->mirrorMargins = 1; // Use different Odd/Even headers and footers and mirror margins

   $mpdf->defaultheaderfontsize = 10; /* in pts */
   $mpdf->defaultheaderfontstyle = B; /* blank, B, I, or BI */
   $mpdf->defaultheaderline = 1;  /* 1 to include line below header/above footer */

   $mpdf->defaultfooterfontsize = 12; /* in pts */
   $mpdf->defaultfooterfontstyle = B; /* blank, B, I, or BI */
   $mpdf->defaultfooterline = 1;  /* 1 to include line below header/above footer */


   $mpdf->SetHeader('{DATE j-m-Y}|{PAGENO}/{nb}|Hoá đơn');
   $mpdf->SetFooter('{PAGENO}/{nb}|Winesey.com.vn'); /* defines footer for Odd and Even Pages - placed at Outer margin */

   $mpdf->SetFooter(array(
    'L' => array(
     'content' => 'Text to go on the left',
     'font-family' => 'sans-serif',
     'font-style' => 'B', /* blank, B, I, or BI */
     'font-size' => '10', /* in pts */
    ),
    'C' => array(
     'content' => '- {PAGENO} -',
     'font-family' => 'serif',
     'font-style' => 'BI',
     'font-size' => '18', /* gives default */
    ),
    'R' => array(
     'content' => 'Printed @ {DATE j-m-Y H:m}',
     'font-family' => 'monospace',
     'font-style' => '',
     'font-size' => '10',
    ),
    'line' => 1,  /* 1 to include line below header/above footer */
   ), 'E' /* defines footer for Even Pages */
   );
  
   $order_id = $this->uri->segment(4);
            
            $data['order'] = $this->MCart->getorder(array('order_id' => $order_id));
            
            $data['order_items'] = $this->MCart->get_order_items($order_id);    
  
   //echo $this->load->view("backend/cart/printorder",$data,TRUE);
  
   $mpdf->WriteHTML($this->load->view("backend/cart/printorder",$data,TRUE));
   $mpdf->Output();
  
        }


Messages In This Thread
mpdf with dynamic data - by El Forum - 10-17-2012, 09:42 AM
mpdf with dynamic data - by El Forum - 10-19-2012, 12:26 PM
mpdf with dynamic data - by El Forum - 10-19-2012, 01:28 PM
mpdf with dynamic data - by El Forum - 10-19-2012, 01:34 PM
mpdf with dynamic data - by El Forum - 10-19-2012, 07:50 PM
mpdf with dynamic data - by El Forum - 10-19-2012, 10:03 PM
mpdf with dynamic data - by El Forum - 10-20-2012, 04:59 PM
mpdf with dynamic data - by El Forum - 10-21-2012, 09:11 PM
mpdf with dynamic data - by El Forum - 10-22-2012, 06:48 AM
mpdf with dynamic data - by El Forum - 10-22-2012, 10:20 AM
mpdf with dynamic data - by El Forum - 10-22-2012, 10:38 AM
mpdf with dynamic data - by El Forum - 10-22-2012, 10:55 AM
mpdf with dynamic data - by El Forum - 10-22-2012, 05:14 PM
mpdf with dynamic data - by El Forum - 10-22-2012, 05:15 PM



Theme © iAndrew 2016 - Forum software by © MyBB