Código:
<?php require_once('class.ezpdf.php'); include('class.backgroundpdf.php'); $pdf = new backgroundPDF('a4', 'portrait', 'image', array('img' => 'img.jpg')); $pdf->selectFont('../fonts/courier.afm'); $pdf->ezSetCmMargins(1,1,1.5,1.5); $conexion = mysql_connect('localhost', '', ''); mysql_select_db("cive", $conexion); $queEmp = "SELECT * FROM usuarios where nif='12345678a' ORDER BY nombre ASC"; $resEmp = mysql_query($queEmp, $conexion) or die(mysql_error()); $totEmp = mysql_num_rows($resEmp); while($datatmp = mysql_fetch_assoc($resEmp)) { $data[] = array_merge($datatmp); } $titles = array( 'nombre'=>'<b>Empresa</b>', 'direccion'=>'<b>Direccion</b>', 'telefono'=>'<b>Telefono</b>' ); $options = array( 'shadeCol'=>array(0.9,0.9,0.9), 'xOrientation'=>'center', 'width'=>10 ); $pdf->ezImage("img.jpg", 80, 80, 'none', 'left'); $pdf->ezTable($data, $titles, '', $options); $pdf->ezText("\n\n\n", 10); $pdf->ezText("<b>Fecha:</b> ".date("d/m/Y"), 10); $pdf->ezText("<b>Hora:</b> ".date("H:i:s")."\n\n", 10); $pdf->ezStream(); ?>
un saludo y graciass a todos