require_once(APPPATH."third_party/dompdf/dompdf_config.inc.php"); $dompdf = new Dompdf(); $jasperReportUrl = 'jasper report url contains username and password and ip.....'; // Initialize cURL session $ch = curl_init($jasperReportUrl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $reportContent = curl_exec($ch); if ($reportContent === false) { echo 'cURL Error: ' . curl_error($ch); } else { $dompdf->load_html($reportContent); $dompdf->set_paper('A4', 'portrait'); ini_set('memory_limit', '256M'); set_time_limit(300); $dompdf->render(); $pdfFilePath = 'file path'; file_put_contents($pdfFilePath, $dompdf->output()); $this->email->attach($pdfFilePath); } curl_close($ch);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)