$pdf = new FPDF(); $pdf->AddPage(); $pdf->Image('ChristianGauthier',10,6,30); $pdf->SetFont('Arial','B',15); // Décalage à droite $pdf->Cell(80); // Titre $pdf->Cell(30,10,'ChristianGauthier',1,0,'C'); // output $pdf->Output();
<?php require('fpdf17/fpdf.php'); class tt extends FPDF{ private $v; function Getter($t){ $this->v = $t; } function Header(){ //Image(string file, float x, float y [, float w [, float h [, string type [, mixed link]]]]) $this->Image($this->v,10,6,30,30,'JPG'); $this->SetFont('Arial','B',15); // Décalage à droite $this->Cell(80); // Titre /*faut prevoir une logique de nommage*/ $name=explode('.',$this->v); $name[0]=str_replace('_',' ',$name[0]); $this->Cell(70,10,$name[0],1,0,'C'); } } if(isset($_GET['fairepdf']) && !empty($_GET['fairepdf'])){ $that=$_GET['fairepdf']; $pdf = new tt('P'); $pdf->Getter($that); $pdf->AddPage(); $pdf->SetFont('Times','',12); $pdf->Output(); }else{ } $thisimage='Christian_Gauthier.jpg'; echo '[?fairepdf='.urlencode($thisimage).' ]'; ?>
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question