Este es el código
Código PHP:
<?php
$id=$_REQUEST["id"];
$usuariobd="root";
$passbd="";
$base="plat";
mysql_connect("localhost",$usuariobd,$passbd);
$result=mysql_db_query($base,"select * from emergencias where id=$id");
while ($row=mysql_fetch_array($result))
{
$radio_base=$row["radio_base"];
$fecha=$row["fecha"];
$hora_r=$row["hora_r"];
$hora_s=$row["hora_s"];
$tecnico=$row["tecnico"];
$p_reporta=$row["p_reporta"];
$detalle=$row["detalle"];
$estado=$row["estado"];
$detalle_e=$row["detalle_e"];
$tecnico=$row["tecnico"];
}
?>
<?php
include('pdf/class.ezpdf.php');
$pdf =& new Cezpdf('a4');
$pdf->selectFont('fonts/Helvetica.afm');
$datacreator = array (
'Title'=>'Reporte de Emergencias',
'Author'=>'',
'Subject'=>'Reporte de Emergencias',
'Creator'=>'http://www.aplitec.net',
'Producer'=>'http://www.aplitec.net'
);
$pdf->addInfo($datacreator);
$data[] = array('c1'=>$fecha, 'c2'=>$hora_r, 'c3'=>$hora_s, 'c4'=>$id);
$titles = array('c1'=>'<b>Fecha</b>', 'c2'=>'<b>Hora de reporte</b>', 'c3'=>"<b>Hora de solucion</b>", 'c4'=>'<b>ID Emergencia</b>');
$options=array('showHeadings' => 1,'xPos' => 'left','xOrientation' => 'right','fontSize' => 12);
$pdf->ezText("Reporte de emergencia: <b>".$radio_base."</b>\n",16);
$pdf->ezTable($data,$titles,'',$options );
$pdf->ezText("\nReportado por: <b>".$p_reporta."</b>\n",12);
$pdf->ezText("\n\n<b>Diagnostico:</b> \n".$detalle."\n",12);
$pdf->ezText("\n\n<b>Detalles y acciones realizadas:</b> \n".$detalle_e."\n",12);
$pdf->ezText("\n\n<b>Responsable:</b>".$tecnico."\n",12);
$pdf->ezText("\n_____________________________________________________________________________________________",10);
$bajo[] = array('c1'=>"<b>".$estado."</b>", 'c2'=>date("d/m/Y")." - - ".date("H:i:s"));
$options=array('showHeadings' => 0,'xPos' => 'left','xOrientation' => 'right','fontSize' => 10,'showLines'=> 0);
$pdf->ezTable($bajo,'','',$options );
$pdf->ezStream();
?>
Este es el error que sale
%PDF-1.3 %âãÏÓ 1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >> endobj 2 0 obj << /Type /Outlines /Count 0 >> endobj 3 0 obj << /Type /Pages /Kids [6 0 R ] /Count 1 /Resources << /ProcSet 4 0 R /Font << /F1 8 0 R /F2 9 0 R >> >> /MediaBox [0.000 0.000 595.280 841.890] >> endobj 4 0 obj [/PDF /Text ] endobj 5 0 obj << /Creator (
http://www.aplitec.net) /CreationDate (D:20080710) /Title (Reporte de Emergencias) /Author () /Subject (Reporte de Emergencias) /Producer (
http://www.aplitec.net) >> endobj 6 0 obj << /Type /Page /Parent 3 0 R /Contents [ 7 0 R 10 0 R 11 0 R ] >> endobj 7 0 obj << /Filter /FlateDecode /Length 360 >> stream xœµ’»RÃ0Eû|Å–Ð,ÒÊz¥d’�%÷Œ°E0câ`‡¾%&A‰GƒÙ¾£»{tW“ËCÆ h+PØÊ.¸BåÀÙÒoº~ë¡öàŸ}¿òëªqS8‡ò æå$ª 4Öì*}Ôâµ_Ñì¿ÖåU\AZd¤FN†…¯]ÔQË°O¿ÿºëݸÙ#'VÒô»uèÚתéÖ‘—Œ@Å~ðÞÌ`~Œè`|™Lnã3¡4ô™ R¤3ƒš³cþtš¿«;ï\îʆ܅I**ÃÐ*•êJ#'}ªK�D”kÖ¸Õº¶MÕM÷íOs H¢�,mA�Aå<$›¢J«Q‹U†I•Cõ[׶~€7pÕn|á³÷®mÞ]í†?ÒKeÑÚ”^J…œ§ô² ¤"CO…ÎÐó%ËÐ/ý°éÖƒ»oý4ƒÅ*‘b&\G�ѵFÝ(vhs÷ŸO|í?�ëŠ ñ endstream endobj 8 0 obj << /Type /Font /Subtype /Type1 /Name /F1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >> endobj 9 0 obj << /Type /Font /Subtype /Type1 /Name /F2 /BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding >> endobj 10 0 obj << /Filter /FlateDecode /Length 155 >> stream xœ]�1!E{NñKm"$°ÁÖµWŽàX8Z{}W„ÝH“™¼yüÜ¡€³Ðä*™bŠ(7ìN�É£Ü �MØ¢<< /Filter /FlateDecode /Length 81 >> stream xœMŒ± €0ûLñ%$ï’ &ðˆ‚ýÀ%ºîtºt83I¬ÖrWÂoœžÂ+³™ý}¹5ü&aáV*¹c ؇ê�:Ãß8|8WM endstream endobj xref 0 12 0000000000 65535 f 0000000015 00000 n 0000000080 00000 n 0000000126 00000 n 0000000290 00000 n 0000000319 00000 n 0000000513 00000 n 0000000594 00000 n 0000001027 00000 n 0000001134 00000 n 0000001246 00000 n 0000001475 00000 n trailer << /Size 12 /Root 1 0 R /Info 5 0 R >> startxref 1629 %%EOF