Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/03/2004, 06:00
karl0x
 
Fecha de Ingreso: marzo-2004
Mensajes: 77
Antigüedad: 22 años, 8 meses
Puntos: 0
Pregunta Ayuda con R&IOS

Tengo un problema con el PDF de R&OS , estoy utilizando PHP Version 4.3.4 y el info del PHP tengo como PDF: PDFlib GmbH Version 4.0.2, y el r&os version 009,l no se donde estara el error del siguiente codigo ya k al ejecutarlo me sale como basurita, espero k me puedan ayudar a encontrar el error..:p

Código PHP:
// test the table functions
error_reporting(E_ALL);
include(
'class.ezpdf.php');
$pdf =& new Cezpdf('A4','portrait');
$pdf->selectFont('./fonts/Helvetica');
$pdf->ezStartPageNumbers(500,18,10,'','{PAGENUM} de {TOTALPAGENUM}',1);

// coloca una linea arriba y abajo de todas las paginas
$all = $pdf->openObject();
$pdf->saveState();
$pdf->setStrokeColor(0,0,0,1);
$pdf->line(20,30,750,30);
$pdf->line(20,585,750,585);
$pdf->addText(20,590,10,'[Programa Internacional de Becas]');
$pdf->addText(400,18,10,'Pagina');
$pdf->restoreState();
$pdf->closeObject();
// termina las lineas
$pdf->addObject($all,'all');
//--------

//--------------------------------------------------
// you will have to change these to your settings
$host = '127.0.0.1';
$user = 'root';
$password = '';
$database = 'ford';
$query = "select cod_postulante, nombres, apel_pat, apel_mat, promed_final ";
$query.="from promedio_notas limit 0,10";
//--------------------------------------------------
// open the connection to the db server
$link = mysql_connect($host,$user,$password);
// change to the right database
mysql_select_db($database);
// initialize the array
$data = array();
// do the SQL query
$result = mysql_query ($query ) or die (mysql_error());
// step through the result set, populating the array, note that this could
//Aqui se coloca el header de la Tabla
$cols = array('cod_postulante'=>'Código',
              
'nombre'=>'Nombres y apellidos',
              
'promed_final'=>'Nota');
$smc=0;

//also have been written:
// while($data[] = mysql_fetch_assoc($result)) {}
while($fila = mysql_fetch_array($result, MYSQL_NUM))
 {
     
$cod_postulante=$fila[0];
     
$nombre=$fila[1]." ".$fila[2]." ".$fila[3];
     
$promed_final=$fila[4];
    
$smc = $smc + 1;
    
    
// Aqui agrego los campos formateados al array
    
$data[] = array('cod_postulante'=>$cod_postulante,
                    
'nombre'=>$nombre,
                    
'promed_final'=>$promed_final);
 }
$nreg = 'Numero de Registros : '.$smc ;
// make the table
$pdf->ezTable($data,$cols,'',array('fontSize'=>6,
'cols'=>array(  'cod_postulante'=>array('justification'=>'center')
                ,
'nombre'=>array('justification'=>'left')
                ,
'promed_final'=>array('justification'=>'left'))));// salida

// do the output, this is my standard testing output code, adding ?d=1
// to the url puts the pdf code to the screen in raw form, good for
//checking
// for parse errors before you actually try to generate the pdf file.
if (isset($d) && $d){
$pdfcode = $pdf->output();
$pdfcode = str_replace("\n","\n<br>",htmlspecialchars($pdfcode));
echo 
'<html><body>';
echo 
trim($pdfcode);
echo 
'</body></html>';
} else {
$pdf->stream();
} 

y esta es la basurita que me sale..:s
%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 >> >> /MediaBox [0.000 0.000 595.280 841.890] >> endobj 4 0 obj [/PDF /Text ] endobj 5 0 obj << /Creator (R and OS php pdf writer, http://www.ros.co.nz) /CreationDate (D:20040302) >> endobj 6 0 obj << /Type /Page /Parent 3 0 R /Contents [ 7 0 R 9 0 R 10 0 R ] >> endobj 7 0 obj << /Filter /FlateDecode /Length 207 >> stream xœ�Ñ=n1à~Oñʤ™ÌØÞñ¸ JÒE òˆvADD–4œ› ĬAÁ�B3’5ï“ì犉™q:ûEÅdÃñ8§oÕs†“@, cG©È ž^JŒ<&»f¹è‘¿ð’bá"xï¾?ûvƒ-f?íjµlºÍ‰öê)8»¢g‡øúÌ¥ËK ibĨäÍAL(••0%¯è[ÌoÀ:P-|ôŽÔÛ°$£êÿ¡š‘¥pVûBCtäö~zì³äÆBM +ý׌rì endstream endobj 8 0 obj << /Type /Font /Subtype /Type1 /Name /F1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >> endobj 9 0 obj << /Filter /FlateDecode /Length 131 >> stream xœã*ä2Ð300P@&ƒÜ¹Œ ,c•«`nŠ"�£ SbjaЦ&Rä¢Sg ¡CRôÝ  �<…�4�耢üô¢ÄÜDϼ’Ô¢¼ÄäÌü¼Ä…”T§ÔäÄâXM…�,×�Y &C -°›�˜ž™—ÓÀœ.2Ò endstream endobj 10 0 obj << /Filter /FlateDecode /Length 561 >> stream xœ••MoÛ0 †ïù,�Ä+äcH‚ ÛMH´Ì…cJÛaýÇ;ïÌiâÖkH »ØÁ—|D½´Ã5$¢ÓÒL µÖ;øðQ‚EëoïD"Œ¨÷°¾ƒb=8itŠBjVSʪl`ÒÌÂ.úº�•¯· ßÃS¯Š² uâØ* Ó,íwíHÓ S•0¤V Š”ÑLš¸𹬎M Ëð3aýcCa2%4¦BR˜Öµ°×˜æŒ))LF“×彇™�¥‡esç��ïÊÊGŠ“ ë‹6É(N“¢³‚§¥8Í(_N+¸)æùrËâK±‚|TlŠñ‚"eª(”޼xm1K4 7QM^<£Ù„ø».·v¡‚O§QBÚûèaäk_…#Ì´Æ �•ÁÌ;u&-ÀhþË\_4–´jbPb£.œ ÅÉhF•صŒÓ&†ÚÃÜÇGž`ÔÔ÷1DOŽ•k�6µ®Ô(%áð³c5éXFsþücó -»ùâä`v£tJñ1šö·¡*ÛIæ‡_ñd؉/-ì,Ô»æÉS¸L)�Ê×f &špõ׸œ&ŸÓÛfÅ||û5æSXåóñb“O P®ˆAe^,'°ýû@ÿ¹¼Hø1H„D› pR¢kßè"Ö¹6¢¡‚Õ9S'ÏнÌKäm¦2î™ì5³‹\e:…æ¯î]äª{K%ßdj½È)³cO³ _нz]¤Ë’½¯µz]ÿ Åñ endstream endobj xref 0 11 0000000000 65535 f 0000000015 00000 n 0000000080 00000 n 0000000126 00000 n 0000000280 00000 n 0000000309 00000 n 0000000414 00000 n 0000000494 00000 n 0000000774 00000 n 0000000881 00000 n 0000001085 00000 n trailer << /Size 11 /Root 1 0 R /Info 5 0 R >> startxref 1720 %%EOF