Ver Mensaje Individual
  #7 (permalink)  
Antiguo 20/08/2011, 21:47
dante14
 
Fecha de Ingreso: marzo-2009
Mensajes: 356
Antigüedad: 15 años, 2 meses
Puntos: 7
Respuesta: Error al pasar lista a pdf

Código HTML:
Ver original
  1. <?php
  2. include('../../controllers/conexion.php');
  3. require_once("../dompdf_config.inc.php");
  4. include('../../models/Productos.php');
  5. session_start();
  6. ob_start();
  7. ?>
  8.  
  9. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  10. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  11.     <link rel="STYLESHEET" href="css/print_static.css" type="text/css" />
  12. </head>
  13.  
  14.  
  15. <div id="body">
  16.  
  17. <div id="section_header">
  18. </div>
  19.  
  20. <div id="content">
  21.  
  22. <div class="page" style="font-size: 7pt">
  23. <table class="change_order_items titulo_tabla">
  24.  <tr><th>REPORTE DE PRODUCTOS</th></tr>
  25.  
  26.  
  27. <table class="change_order_items">
  28.     <tbody>
  29.         <tr>
  30.             <th width="3%">#</th>
  31.             <th width="90%">Producto</th>
  32.             <th width="7%">Unidad de Medida</th>
  33.             <th width="3%" class="nowrap">ID</th>
  34.         </tr>
  35.         <?php
  36.            $productos = new Productos();
  37.            foreach ($productos->ListarTodosProductos() as $one){
  38.         ?>
  39.         <tr class="row<?php echo $color_fila; ?>">
  40.             <td class="center"><?php echo $i;  ?></td>
  41.             <td class="left"><?php echo $one -> PROD_NOMB;  ?></td>
  42.             <td class="left"><?php echo $one -> UMED_NOMB;  ?></td>
  43.             <td class="center"><?php echo $one -> PROD_CODI;  ?></td>
  44.         </tr>
  45.      <?php
  46.                }
  47.        ?>
  48.  
  49.    </tbody>
  50.    </table>
  51.  
  52. </div>
  53.  
  54. </div>
  55. </div>
  56. </body>
  57. </html>
  58.  
  59. <?php
  60. $html = ob_get_contents();
  61. ob_end_clean();
  62.  
  63. $dompdf = new DOMPDF();
  64.  
  65. $dompdf->load_html($html);
  66. $dompdf->render();
  67. $dompdf->stream("prueba.pdf");
  68. ?>


ese es mi codigo

y ya cambie el tiempo y todo; pero me sale que el archivo pdf esta dañado. no se a que se debe