if ($result <= 0) { print "Error: Failed to build PDF for invoice ".$fac->ref."\n"; } $cpt++; } // Now, build a merged files with all files in $files array //--------------------------------------------------------- // Create empty PDF $pdf=new FPDI('P','mm','A4'); if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); //$pdf->SetCompression(false); if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); } $pdf->SetFont(pdf_getPDFFont($outputlangs)); //$pdf->Open(); //$pdf->AddPage(); //$title=$langs->trans("BillsCustomersUnpaid"); //if ($option=='late') $title=$langs->trans("BillsCustomersUnpaid"); //$pdf->MultiCell(100, 3, $title, 0, 'J');
} $factures = dol_dir_list($conf->facture->dir_output, 'all', 1, implode('|', $arrayofexclusion), '\\.meta$|\\.png', 'date', SORT_DESC); // liste les fichiers $files = array(); $factures_bak = $factures; foreach ($_POST['toGenerate'] as $basename) { foreach ($factures as $facture) { if (strstr($facture["name"], $basename)) { $files[] = $conf->facture->dir_output . '/' . $basename . '/' . $facture["name"]; } } } // Create empty PDF $pdf = new FPDI('P', 'mm', 'A4'); if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) { $pdf->SetCompression(false); } if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); } //$pdf->SetFont(pdf_getPDFFont($outputlangs)); //$pdf->Open(); //$pdf->AddPage(); //$title=$langs->trans("BillsCustomersUnpaid"); //if ($option=='late') $title=$langs->trans("BillsCustomersUnpaid"); //$pdf->MultiCell(100, 3, $title, 0, 'J'); // Add all others foreach ($files as $file) { // Charge un document PDF depuis un fichier. $pagecount = $pdf->setSourceFile($file);