Esempio n. 1
0
 if ($counter > 0) {
     // print
     //Some variables
     $table_full_width = 190;
     $table_col_width = array(45, 40, 45, 60);
     $table = array('label', 'login', 'pw', 'description');
     $prev_path = "";
     //Prepare the PDF file
     include $_SESSION['settings']['cpassman_dir'] . '/includes/libraries/Pdf/Tfpdf/fpdf.php';
     $pdf = new FPDF_Protection();
     $pdf->SetProtection(array('print'), $_POST['pdf_password']);
     //Add font for regular text
     $pdf->AddFont('DejaVu', '', 'DejaVuSansCondensed.ttf', true);
     //Add monospace font for passwords
     $pdf->AddFont('LiberationMono', '');
     $pdf->aliasNbPages();
     $pdf->addPage();
     $pdf->SetFont('DejaVu', '', 16);
     $pdf->Cell(0, 10, $LANG['print_out_pdf_title'], 0, 1, 'C', false);
     $pdf->SetFont('DejaVu', '', 12);
     $pdf->Cell(0, 10, $LANG['pdf_del_date'] . " " . date($_SESSION['settings']['date_format'] . " " . $_SESSION['settings']['time_format'], time()) . ' ' . $LANG['by'] . ' ' . $_SESSION['login'], 0, 1, 'C', false);
     $prev_path = "";
     $table = array('label', 'login', 'pw', 'description');
     foreach ($rows as $record) {
         $printed_ids[] = $record['id'];
         if ($prev_path != $record['path']) {
             $pdf->SetFont('DejaVu', '', 10);
             $pdf->SetFillColor(192, 192, 192);
             error_log('key: ' . $key . ' - paths: ' . $record['path']);
             $pdf->cell(0, 6, $record['path'], 1, 1, "L", 1);
             $pdf->SetFillColor(222, 222, 222);