Tema: generar pdf
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/04/2009, 23:58
ron234
 
Fecha de Ingreso: noviembre-2008
Mensajes: 48
Antigedad: 15 aos, 5 meses
Puntos: 0
generar pdf

<?php
include_once('class.ezpdf.php');
$pdf =& new Cezpdf('a4');
$pdf->selectFont('../fonts/courier.afm');
$pdf->ezSetCmMargins(1,1,1.5,1.5);

$conexion = mysql_connect("localhost", "root", "123");
mysql_select_db("demo", $conexion);
$queEmp = "SELECT nombre, direccion, telefono FROM empresa";
$resEmp = mysql_query($queEmp, $conexion) or die ("Error al intentar Generar el reporte de Usuarios");
$totEmp = mysql_num_rows($resEmp);

$ixx = 0;
while($datatmp = mysql_fetch_assoc($resEmp)) {
$ixx = $ixx+1;
$data[] = array_merge($datatmp, array('num'=>$ixx));
}
$titles = array(
'num'=>'<b>Num</b>',
'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'=>500
);
$txttit = "<b>BLOG.UNIJIMPE.NET</b>\n";
$txttit.= "Ejemplo de PDF con PHP y MYSQL \n";

$pdf->ezText($txttit, 12);
$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();
?>

tengo este codigo para generar pdf en php lo unico malo cuando lo corro en internet explorer me sale estos simbolos que ves acontinuacion espero que alguien me pueda ayudar a resolver el problema gracias

PDF-1.3 % 1 0 obj <> endobj 2 0 obj <> endobj 3 0 obj << /Type /Pages /Kids [6 0 R ] /Count 1 /Resources <> /MediaBox [0.000 0.000 595.280 841.890] >> endobj 4 0 obj [/PDF /Text ] endobj 5 0 obj <> endobj 6 0 obj <> endobj 7 0 obj <> stream x0Ew⎺Ce40vT[bB :wM.R""Ug4x5p(>Ai7 >i/*Cpu]?=WRd$2&R?Xt1,s> !iP endstream endobj xref 0 8 0000000000 65535 f 0000000015 00000 n 0000000080 00000 n 0000000126 00000 n 0000000257 00000 n 0000000286 00000 n 0000000469 00000 n 0000000532 00000 n trailer <> startxref 756 %%EOF