Esempio n. 1
0
     //row height calculation
     $nb = 0;
     $nb = max($nb, nbLines($table_col_width[0], $record['label']));
     $nb = max($nb, nbLines($table_col_width[3], $record['description']));
     $nb = max($nb, nbLines($table_col_width[2], $record['pw']));
     $h = 5 * $nb;
     //Page break needed?
     checkPageBreak($h);
     //Draw cells
     $pdf->SetFont('DejaVu', '', 9);
     for ($i = 0; $i < count($table); $i++) {
         $w = $table_col_width[$i];
         $a = 'L';
         //actual position
         $x = $pdf->GetX();
         $y = $pdf->GetY();
         //Draw
         $pdf->Rect($x, $y, $w, $h);
         //Write
         $pdf->MultiCell($w, 5, stripslashes($record[$table[$i]]), 0, $a);
         //go to right
         $pdf->SetXY($x + $w, $y);
     }
     //return to line
     $pdf->Ln($h);
 }
 $pdf_file = "print_out_pdf_" . date("Y-m-d", mktime(0, 0, 0, date('m'), date('d'), date('y'))) . "_" . generateKey() . ".pdf";
 //send the file
 $pdf->Output($_SESSION['settings']['path_to_files_folder'] . "/" . $pdf_file);
 //log
 logEvents('pdf_export', "", $_SESSION['user_id'], $_SESSION['login']);