SetCreator(PDF_CREATOR); $pdf->SetAuthor('Nicola Asuni'); $pdf->SetTitle('ATTESTATION DE TRAVAIL'); $pdf->SetSubject('TCPDF Tutorial'); $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); // 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); // 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 (optional) if (@file_exists(dirname(__FILE__).'/lang/eng.php')) { require_once(dirname(__FILE__).'/lang/eng.php'); $pdf->setLanguageArray($l); } // add a page $pdf->AddPage(); $pdf->SetFont('times', 'I', 12); $pdf->Cell( 0, 0, 'Oran, le '.date('d/m/Y', strtotime($response['date_creation'])), 0, 1 ,'R'); //$pdf->writeHTML("
", true, false, false, false, ''); $pdf->Ln(); $pdf->Cell( 0, 0, 'Réf N° : '.$response['num_reference'].'/DRH/SS/LR/'.date('Y', strtotime($response['date_creation'])), 0, 1 ,'L'); $pdf->Ln(); $pdf->Ln(); $pdf->SetFont('times', 'BI', 20); $txt = <<Write(0, $txt, '', 0, 'C', true, 0, false, false, 0); $pdf->Ln(); $pdf->SetFont('times', 'I', 12); $v = '
Nous, soussignés SPA Société Pharmaceutique Algérienne, par abréviation SOPHAL dont le Siège est situé à Bir-El-Djir (Oran) Boîte Postale 10.
Attestons que
Matricule : '.$response['matricule'].'
Mr : '.$response['fullname'].'
Né (e) le : '.date('d/m/Y', strtotime($response['date_naissance'])).' à : '.$response['lieu_naissance'].'
'; $pdf->writeHTML($v, true, false, false, false, ''); $pdf->SetFont('times', 'BI', 12); $pdf->Cell( 0, 0, 'Est employé (e) au sein de la Société en qualité de :', 0, 1 ,'L'); $pdf->SetFont('times', 'I', 12); $v = '
'.$response['fonction'].'
Structure : '.$response['structure'].'
Depuis le : '.date('d/m/Y', strtotime($response['date_recrutement'])).' à ce jour
la présente attestation lui est délivré pour servir et valoir ce que de droit.
'; $pdf->writeHTML($v, true, false, false, false, ''); $pdf->SetFont('times', 'BIU', 12); $visa = '
NB : A USAGE ADMINISTRATIF Le Directeur des Ressources Humaines
'; $pdf->writeHTML($visa, true, false, false, false, ''); $pdf->Ln(); $pdf->SetFont('times', 'BIU', 12); $qr = '
'; $pdf->writeHTML($qr, true, false, false, false, ''); //qr code $style = array( 'border' => 0, 'vpadding' => 'auto', 'hpadding' => 'auto', 'fgcolor' => array(0,0,0), 'bgcolor' => false, //array(255,255,255) 'module_width' => 1, // width of a single module in points 'module_height' => 1 // height of a single module in points ); $setText = 'Matricule:'.$response['matricule'].', Mr:'.$response['fullname'].', Date Naissance:'.date('d/m/Y', strtotime($response['date_naissance'])).' à '.$response['lieu_naissance'].', fonction:'.$response['fonction'].' structure:'.$response['structure'].', depuis le:'.date('d/m/Y', strtotime($response['date_recrutement'])).' le:'.date('d/m/Y', strtotime($response['date_creation'])); //delete all spaces $filtreText = preg_replace('/\s+/', ' ', $setText); $pdf->write2DBarcode($filtreText, 'QRCODE,M', 33, 190, 50, 30, $style, 'N'); $pdf->Output('attestation_de_travail.pdf', 'I');