Ver Mensaje Individual
  #5 (permalink)  
Antiguo 25/10/2011, 13:17
Avatar de CesarHC
CesarHC
 
Fecha de Ingreso: junio-2011
Ubicación: localhost
Mensajes: 566
Antigüedad: 12 años, 10 meses
Puntos: 56
Respuesta: Dompdf y myssql

Gracias por responder es lo que necesitaba, lo he probado pero me bota un error:

Fatal error: Call to undefined method Inline_Frame_Decorator::normalise() in C:\xampp\htdocs\reqcot\pdf\dompdf\include\table_fr ame_decorator.cls.php on line 252


este es el codigo que tengo:

Código PHP:
Ver original
  1. <?php
  2. require_once("../pdf/dompdf/dompdf_config.inc.php");
  3.  
  4. /*
  5. mysql_query...
  6. mysql_fetch...
  7. */
  8. $link = mysql_connect("localhost", "root","");
  9. mysql_select_db("reqcot", $link);  
  10. $result = mysql_query("SELECT * FROM prueba ", $link);
  11. $html="";
  12. if ($row = mysql_fetch_array($result)){
  13.  $html.="<table width='200' border='1' align='center' >
  14.    <td align='center'>Nombre</td>
  15.    <td align='center'>Apellido</td>";
  16.    
  17.    do {
  18.       $html.= "
  19.  <tr>
  20.    <td align='center'>".$row["nombre"]."</td>
  21.    <td align='center'>".$row["apellido"]."</td>
  22.    <td align='center'>
  23.     <form action='frmprueba.php' method='get'>
  24.         <input type='hidden' name='idprueba' value=".$row["idprueba"]." />
  25.         <input type='hidden' name='nombre' value=".$row["nombre"]." />
  26.         <input type='hidden' name='apellido' value=".$row["apellido"]." />      
  27.    </form>
  28.     </td>
  29.  </tr>
  30.      ";
  31.    } while ($row = mysql_fetch_array($result));
  32.    $html.="</table> \n";
  33. } else {
  34. $html.= "¡ No se ha encontrado ningún registro !";
  35. }
  36.  
  37. $dompdf = new DOMPDF();
  38. $dompdf->load_html($html);
  39. $dompdf->render();
  40. $dompdf->stream("sample.pdf");
  41. /*
  42. Add mail to code to attach /tmp/sample.pdf to a email and send
  43. */
  44. ?>


lo raro es que funciona en el mpdf XD al parecer no encuentra una clase o habia que configurar algo, igualmente gracias si me indicaron algo para solucionar ese error seria de gran ayuda.
__________________
Solo la práctica no te traicionara ¡¡¡¡¡¡

Seguir el camino tu debes PHP The Right Way.