Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function downloadpdf()
- {
- $pak_id = $this->uri->segment(3);
- $data['detail'] = $this->pak_model->select_by_pak($pak_id)->row();
- $time = time();
- $filename = 'CetakPAK_'.$pak_id.'_'.$time;
- $pdfFilePath = FCPATH."/download/$filename.pdf";
- if (file_exists($pdfFilePath) == FALSE){
- ini_set('memory_limit','50M');
- $html = $this->load->view('printpdf_view', $data, true);
- $this->load->library('pdf');
- $pdf = $this->pdf->load();
- $pdf->SetHeader('');
- $pdf->SetFooter('');
- $pdf->WriteHTML($html);
- $pdf->Output($pdfFilePath, 'F');
- }
- redirect("/download/$filename.pdf");
- }
Add Comment
Please, Sign In to add comment