I am using PHP Codeigniter While I will try to convert pdf for multiple pages, the next page data coming on the first pages. I want to convert pages data page wise. How can I do it?
I have followed this code:
Controller:
<?php $createPDFFile="myData.pdf"; $data['user_data'] = $returnData; $htmlContent = $this->load->view('admin/download_user_data', $data, TRUE); $this->createPDF(FCPATH.'assets/generate_pdf/'.$createPDFFile, $htmlContent); ?>
in View
<?php if(!empty($user_data)) { foreach($user_data as $pdata) { ?> <!-- Here My html Code --> <?php } } ?>
Question and answer is powered by AnsPress.io