Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/12/2010, 10:28
Avatar de JuJoGuAl
JuJoGuAl
 
Fecha de Ingreso: julio-2009
Ubicación: Venezuela
Mensajes: 754
Antigüedad: 14 años, 9 meses
Puntos: 19
Pregunta Convertir una tabla HTML en PDF

Buenos dias amigos, tengo una tabla HTML que contiene los resultados de una consulta hecha en php + mysql

Código HTML:
Ver original
  1. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  2. <script type="text/javascript" src="../swfobject.js"></script>
  3. <style type="text/css">
  4. <!--
  5. body {
  6.     margin-left: 0px;
  7.     margin-top: 0px;
  8.     margin-right: 0px;
  9.     margin-bottom: 0px;
  10. }
  11. #flashcontent {
  12.         width: 300px;
  13.         height: 150px;
  14.     }
  15. .style6 {font-size: 1px}
  16. .style8 {font-size: 4px}
  17. a:link {
  18.     color: #006699;
  19. }
  20. a:visited {
  21.     color: #006699;
  22. }
  23. a:hover {
  24.     color: #006699;
  25. }
  26. a:active {
  27.     color: #006699;
  28. }
  29. -->
  30. function imprimir()
  31. {
  32.   var Obj = document.getElementById("desaparece");
  33.   Obj.style.visibility = 'hidden';
  34.   window.print();
  35. }
  36. </head>
  37. <font face="Arial">
  38.  
  39. <table border="0" width="100%" cellspacing="0">
  40. <tr>
  41.   <td width="30%">
  42.       <table border="0" width="100%" cellspacing="0">
  43.              <tr>
  44.                  <td><img src="imagenes/LogoAlcaldia.PNG" width="232" height="60"></td>
  45.              </tr>
  46.       </table>
  47.   </td>
  48.   <td align="center" width="50%">
  49.   <font size="3">CEMENTERIO MUNICIPAL JARDIN SANTA LUCIA</font><BR>
  50.   <font size="4">REGISTRO DE INHUMACIONES</font>
  51.   </td>
  52.   <td width="20%"></td>
  53.  
  54. <BR>
  55. <table border="1" width="100%" cellspacing="0">
  56.          <tr>
  57.              <td align="center" class="Reporte" width="2%"><font size="3"><b>#</b></td>
  58.              <td align="center" class="Reporte" width="9%"><font size="2"><b>Permiso de Inhumación</b></td>
  59.              <td align="center" class="Reporte" width="9%"><font size="2"><b>Certificado de Defunción</b></td>
  60.              <td align="center" class="Reporte" width="30%"><font size="3"><b>Nombres y Apellidos</b></td>
  61.              <td align="center" class="Reporte" width="10%"><font size="3"><b>Edad</b></td>
  62.              <td align="center" class="Reporte" width="12%"><font size="3"><b>Fecha de Muerte</b></td>
  63.              <td align="center" class="Reporte" width="13%"><font size="3"><b>Fecha de la Inhumación</b></td>
  64.              <td align="center" class="Reporte" width="15%"><font size="3"><b>Parroquia<BR>donde murió</b></td>
  65.          </tr>
  66. <?php
  67. include("config.php");
  68. $Inhumacion = mysql_query("SELECT * FROM difuntos_totales");
  69. $i=1;
  70. $r=255;
  71. while ( $row=mysql_fetch_row($Inhumacion) )
  72. {
  73. if ($row[3]==""||$row[7]=="")
  74. {
  75. $row[3]="NULL";
  76. $row[7]="NULL";
  77. }
  78. if ($row[5]==""||$row[6]==""||$row[1]==""||$row[2]==""||$row[4]=="")
  79. {
  80. $row[5]="000";
  81. $row[6]="000";
  82. $row[1]="000";
  83. $row[2]="000";
  84. $row[4]="000";
  85. }
  86. echo "<tr>
  87.     <td class=\"Reporte\" align=left>$i</span></td>
  88.     <td class=\"Reporte\" align=left>$row[5]</td>
  89.     <td class=\"Reporte\" align=left>$row[6]</td>
  90.     <td class=\"Reporte\" align=left>$row[3]</td>
  91.     <td class=\"Reporte\" align=left>$row[4]</td>
  92.     <td class=\"Reporte\" align=left>$row[1]</td>
  93.     <td class=\"Reporte\" align=left>$row[2]</td>
  94.     <td class=\"Reporte\" align=left>$row[7]</td>"
  95.     ;
  96.     $i++;
  97.     $r -= 0;
  98. }
  99. mysql_free_result($Inhumacion)
  100. ?>
  101. <table border="0" width="100%" cellspacing="0">
  102. <tr>
  103.   <td><input type="button" id="desaparece" onClick="imprimir()" value="Imprimir"></td>
  104. </tr>
  105. </font>
  106. </body>
  107. </html>

como puedo llevar dicho reporte a un documento PDF????