function ExportToPDF($content) { //echo "pdf"; global $CFG; //$pdf=new PDF(); //Column titles //$header=$data->tabhead; // create new PDF document $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor(''); $pdf->SetTitle('Feedback Report'); $pdf->SetSubject('Feedback Report'); // remove default header/footer $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); // set default monospaced font //$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); //set margins //$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); //set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings $pdf->setLanguageArray($l); // --------------------------------------------------------- // set font $pdf->SetFont('helvetica', '', 8); // add a page $pdf->AddPage('P', 'A4'); ob_clean(); // print a line using Cell() //$pdf->Cell(0, 10, 'Example 002', 1, 1, 'C'); $htmcont = ImprovedTable($content); $pdf->writeHTML($htmcont, true, false, false, false, ''); //echo $htmcont; // --------------------------------------------------------- //Close and output PDF document $pdf->Output("Feedback_Report", 'D'); exit; }
function extractToPDF() { require_once "/var/www/html/rentree/admin/lib/fpdf.php"; $students = getDatas(); $pdf = new FPDF('L', 'mm', 'A4'); $pdf->AddPage(); $pdf->SetFont('Arial', '', 10); $pdf->SetTitle('Etudiants enregistrés', true); $header = array('Identifiant', 'Nom', 'Prenom', 'DDN', 'Telephone', 'Courriel', 'Enregistrement', 'IP'); ImprovedTable($pdf, $header, $students); $pdf->Output(); }