Foros del Web » Creando para Internet » HTML »

Centrar tabla en XHTML

Estas en el tema de Centrar tabla en XHTML en el foro de HTML en Foros del Web. Hola como están, necesito su ayuda: Quiero centrar distintos objetos verticalmente, trabajo con la librería TCPDF, como tablas imágenes. La librería solo permite XHTML, por ...
  #1 (permalink)  
Antiguo 13/03/2012, 10:10
 
Fecha de Ingreso: enero-2012
Ubicación: Lima
Mensajes: 19
Antigüedad: 12 años, 3 meses
Puntos: 1
Centrar tabla en XHTML

Hola como están, necesito su ayuda:

Quiero centrar distintos objetos verticalmente, trabajo con la librería TCPDF, como tablas imágenes.

La librería solo permite XHTML, por lo cual no puedo utilizar div.

Gracias.
  #2 (permalink)  
Antiguo 13/03/2012, 11:46
Avatar de emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 10 meses
Puntos: 1567
Respuesta: Centrar tabla en XHTML

Cita:
Iniciado por zerart245 Ver Mensaje
Hola como están, necesito su ayuda:
La librería solo permite XHTML, por lo cual no puedo utilizar div.
Eso no tiene sentido,
de dónde sacaste esa conclusión?

__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.
  #3 (permalink)  
Antiguo 13/03/2012, 12:11
 
Fecha de Ingreso: enero-2012
Ubicación: Lima
Mensajes: 19
Antigüedad: 12 años, 3 meses
Puntos: 1
Respuesta: Centrar tabla en XHTML

Googleando, y probando. Lo primero que hice fue tratar de centrarlo con los div, algo que no hacia, luego lei que la libreria TCPDF ,su funcion WriteHTML, solo utiliza XHTML
  #4 (permalink)  
Antiguo 13/03/2012, 12:34
Avatar de zerokilled
Javascripter
 
Fecha de Ingreso: abril-2009
Ubicación: Isla del Encanto, La Borinqueña [+>==]
Mensajes: 8.050
Antigüedad: 15 años
Puntos: 1485
Respuesta: Centrar tabla en XHTML

¡buenas!
llevo un rato rompiendome la cabeza tratando de entender tu argumento. antes, comentar que desconozco como trabaja tcpdf. se me hace muy extraño tu comentario porque dices que tcpdf utiliza xhtml pero no puedes utilizar DIV. ¿sabes que DIV es parte de XHTML? en todo caso, un DIV por si solo no tiene formato propio. entonces, ¿tcpdf acepta o interpreta css? si es el caso, entonces por ahí va tu solución.
__________________
la maldad es una virtud humana,
y la espiritualidad es la lucha del hombre contra su maldad.
  #5 (permalink)  
Antiguo 13/03/2012, 12:41
Avatar de emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 10 meses
Puntos: 1567
Respuesta: Centrar tabla en XHTML

mirá los ejemplos 6 y 61 de TCPDF

Funciona perfectamente, solo tenes que definir los estilos, dentro de style o inline, tanto para divs como para otros elementos

Saludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.
  #6 (permalink)  
Antiguo 13/03/2012, 12:44
Avatar de emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 10 meses
Puntos: 1567
Respuesta: Centrar tabla en XHTML

Cita:
Iniciado por zerokilled Ver Mensaje
¡buenas!
llevo un rato rompiendome la cabeza tratando de entender tu argumento. antes, comentar que desconozco como trabaja tcpdf. se me hace muy extraño tu comentario porque dices que tcpdf utiliza xhtml pero no puedes utilizar DIV. ¿sabes que DIV es parte de XHTML? en todo caso, un DIV por si solo no tiene formato propio. entonces, ¿tcpdf acepta o interpreta css? si es el caso, entonces por ahí va tu solución.
Para que te des una idea @zerokilled
http://www.tcpdf.org/examples.php
ahi están códigos php/html y salida pdf
Saludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.
  #7 (permalink)  
Antiguo 13/03/2012, 14:42
 
Fecha de Ingreso: enero-2012
Ubicación: Lima
Mensajes: 19
Antigüedad: 12 años, 3 meses
Puntos: 1
Respuesta: Centrar tabla en XHTML

Cita:
mirá los ejemplos 6 y 61 de TCPDF
Gracias no habia visto el 61 me sirvio de mucho pero aun asi no puedo centrar

Código PHP:
<style>
#tabla{
    
text-align:center
    
bottom:middle
    
margin:auto
    
vertical-align:middle;
}
</
style>
<
div align="right"><table cellpadding="8" cellspacing="0" border="0" style="text-align:left; width:640px"><tr><td width="40" ></td><td align="center" border="1" style="padding:6px; text-align:center " width="115"><img width="91px"  height="135px" src="" /></td><td border="1" style="padding:6px;" width="485"><table id="tabla" cellpadding="0" cellspacing="0" border="0" style="text-align:left; width:500px">
<
tr><td  style="padding:6px;" width="135">Apellidos y nombres </td><td   style="padding:6px;" width="350"><strong>'.$nom.'</strong></td></tr>
<
tr><td  style="padding:6px;" width="135">'.$tip_doc.'</td>    <td   style="padding:6px;" width="350"><strong>'.$dni.'</strong></td></tr>
<
tr><td  style="padding:6px;" width="135">Fecha de nacimiento </td><td   style="padding:6px;" width="350"><strong>'.$fec_nac.'</strong></td></tr>
<
tr><td  style="padding:6px;" width="135">Estado civil </td><td   style="padding:6px;" width="350"><strong>'.$estado.'</strong></td></tr><tr><td  style="padding:6px;" width="135">Sexo</td><td   style="padding:6px;" width="350"><strong>'.$sexo.'</strong></td></tr>
<
tr><td  style="padding:6px;" width="135">Tel&eacute;fonos</td><td   style="padding:6px;" width="350"><strong>'.$telefonos.'</strong></td></tr>
<
tr><td  style="padding:6px;" width="135">Correos electr&oacute;nicos </td><td   style="padding:6px;" width="350"><strong>'.$correos.'</strong></td></tr>
</
table></td></tr></table></div
Si me pudieras ayudar se los agradecería bastante.
  #8 (permalink)  
Antiguo 13/03/2012, 14:59
Avatar de emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 10 meses
Puntos: 1567
Respuesta: Centrar tabla en XHTML

Primero te aclaro que tu html está bastante "desprolijo" por decirlo de alguna manera
probá con esto, removes el div contenedor y pones otra tabla

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <title>titulo</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6.  
  7. <style type="text/css">
  8. html,body{
  9. height: 100%;
  10. }
  11. </head>
  12.  
  13. <table style="height:100%; width: 100%;" border="1">
  14. <tr>
  15.     <td align="center" valign="middle">
  16.  
  17. <table cellpadding="8" cellspacing="0" border="0" style="text-align:left; width:640px">
  18. <tr><td width="40" ></td><td align="center" border="1" style="padding:6px; text-align:center " width="115"><img width="91px"  height="135px" src="" /></td><td border="1" style="padding:6px;" width="485">
  19. <table id="tabla" cellpadding="0" cellspacing="0" border="0" style="text-align:left; width:500px">
  20. <tr><td  style="padding:6px;" width="135">Apellidos y nombres </td><td style="padding:6px;" width="350"><strong>'.$nom.'</strong></td></tr>
  21. <tr><td  style="padding:6px;" width="135">'.$tip_doc.'</td><td style="padding:6px;" width="350"><strong>'.$dni.'</strong></td></tr>
  22. <tr><td  style="padding:6px;" width="135">Fecha de nacimiento </td><td style="padding:6px;" width="350"><strong>'.$fec_nac.'</strong></td></tr>
  23. <tr><td  style="padding:6px;" width="135">Estado civil </td><td style="padding:6px;" width="350"><strong>'.$estado.'</strong></td></tr><tr><td style="padding:6px;" width="135">Sexo</td><td   style="padding:6px;" width="350"><strong>'.$sexo.'</strong></td></tr>
  24. <tr><td  style="padding:6px;" width="135">Tel&eacute;fonos</td><td style="padding:6px;" width="350"><strong>'.$telefonos.'</strong></td></tr>
  25. <tr><td  style="padding:6px;" width="135">Correos electr&oacute;nicos </td><td   style="padding:6px;" width="350"><strong>'.$correos.'</strong></td></tr>
  26. </table></td></tr></table>
  27.  
  28. </td>
  29. </tr>
  30. </table>  
  31.  
  32. </body>
  33. </html>

y fijate el css que pone html y body al 100%;

Saludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.
  #9 (permalink)  
Antiguo 13/03/2012, 15:18
 
Fecha de Ingreso: enero-2012
Ubicación: Lima
Mensajes: 19
Antigüedad: 12 años, 3 meses
Puntos: 1
Pregunta Respuesta: Centrar tabla en XHTML

Gracias por la ayuda pero, probé, y no hubo movimiento la imagen sigue al lado y la tabla en la parte superior.
  #10 (permalink)  
Antiguo 14/03/2012, 13:25
 
Fecha de Ingreso: enero-2012
Ubicación: Lima
Mensajes: 19
Antigüedad: 12 años, 3 meses
Puntos: 1
Respuesta: Centrar tabla en XHTML

Probé por todos los métodos que pude el centrado vertical pero en TCPDF no lo hace.


  #11 (permalink)  
Antiguo 14/03/2012, 13:54
Avatar de jcorrea  
Fecha de Ingreso: febrero-2012
Ubicación: Bogota
Mensajes: 43
Antigüedad: 12 años, 2 meses
Puntos: 7
Respuesta: Centrar tabla en XHTML

Porque no pones el codigo talvez estas haciendo algo mal
__________________
www.ofitools.com
| En la nube - Soluciones Tecnológicas - Diseño Web - Consultoria Especializada
  #12 (permalink)  
Antiguo 14/03/2012, 14:52
Avatar de emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 10 meses
Puntos: 1567
Respuesta: Centrar tabla en XHTML

Cita:
Iniciado por zerart245 Ver Mensaje
Probé por todos los métodos que pude el centrado vertical pero en TCPDF no lo hace.


Lo qu pasa es que esa librería tiene tres millones de opciones, no alcanza con el html.

Algo se puede lograr, pero no dispongo de tiempo para estudiar todas las opciones

Código PHP:
Ver original
  1. <?php
  2.  
  3. require_once('../config/lang/eng.php');
  4. require_once('../tcpdf.php');
  5.  
  6. // create new PDF document
  7. $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
  8.  
  9. // set document information
  10. $pdf->SetCreator(PDF_CREATOR);
  11. $pdf->SetAuthor('Nicola Asuni');
  12. $pdf->SetTitle('TCPDF Example 061');
  13. $pdf->SetSubject('TCPDF Tutorial');
  14. $pdf->SetKeywords('TCPDF, PDF, example, test, guide');
  15.  
  16. // set default header data
  17. //$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 061', PDF_HEADER_STRING);
  18.  
  19. // set header and footer fonts
  20. $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
  21. $pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
  22.  
  23. // set default monospaced font
  24. $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
  25.  
  26. //set margins
  27. $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
  28. $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
  29. $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
  30.  
  31. //set auto page breaks
  32. $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
  33.  
  34. //set image scale factor
  35. $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
  36.  
  37. //set some language-dependent strings
  38. $pdf->setLanguageArray($l);
  39.  
  40. // ---------------------------------------------------------
  41.  
  42. // set font
  43. $pdf->SetFont('helvetica', '', 10);
  44.  
  45. // add a page
  46. $pdf->AddPage();
  47.  
  48. /* NOTE:
  49.  * *********************************************************
  50.  * You can load external XHTML using :
  51.  *
  52.  * $html = file_get_contents('/path/to/your/file.html');
  53.  *
  54.  * External CSS files will be automatically loaded.
  55.  * Sometimes you need to fix the path of the external CSS.
  56.  * *********************************************************
  57.  */
  58.  
  59. // define some HTML content with style
  60. $html = <<<EOF
  61. <!-- EXAMPLE OF CSS STYLE -->
  62. <style>
  63. html,body{
  64. height: 100%;
  65. }
  66.  
  67. p {
  68. height: 300px;
  69. }
  70. </style>
  71. <table>
  72. <tr><td>
  73. <p><br /><!-- s --><br /><!-- s --><br /><br /><br /><br /></p>
  74. </td></tr></table>
  75. <table style="height:100%; width: 100%;margin-top: 200px;" border="1">
  76. <tr>
  77.     <td align="center" valign="middle">
  78.  
  79. <table cellpadding="8" cellspacing="0" border="0" style="text-align:left; width:640px">
  80. <tr><td width="40" ></td><td align="center" border="1" style="padding:6px; text-align:center " width="115"></td><td border="1" style="padding:6px;" width="485">
  81. <table id="tabla" cellpadding="0" cellspacing="0" border="0" style="text-align:left; width:500px">
  82. <tr><td  style="padding:6px;" width="135">Apellidos y nombres </td><td style="padding:6px;" width="350"><strong>'.$nom.'</strong></td></tr>
  83. <tr><td  style="padding:6px;" width="135">'.$tip_doc.'</td><td style="padding:6px;" width="350"><strong>'.$dni.'</strong></td></tr>
  84. <tr><td  style="padding:6px;" width="135">Fecha de nacimiento </td><td style="padding:6px;" width="350"><strong>'.$fec_nac.'</strong></td></tr>
  85. <tr><td  style="padding:6px;" width="135">Estado civil </td><td style="padding:6px;" width="350"><strong>'.$estado.'</strong></td></tr><tr><td style="padding:6px;" width="135">Sexo</td><td   style="padding:6px;" width="350"><strong>'.$sexo.'</strong></td></tr>
  86. <tr><td  style="padding:6px;" width="135">Tel&eacute;fonos</td><td style="padding:6px;" width="350"><strong>'.$telefonos.'</strong></td></tr>
  87. <tr><td  style="padding:6px;" width="135">Correos electr&oacute;nicos </td><td   style="padding:6px;" width="350"><strong>'.$correos.'</strong></td></tr>
  88. </table></td></tr></table>
  89.  
  90. </td>
  91. </tr>
  92. </table>  
  93. EOF;
  94.  
  95. // output the HTML content
  96. $pdf->writeHTML($html, true, false, true, false, '');
  97.  
  98. *******************************************************************
  99.  
  100. // reset pointer to the last page
  101. $pdf->lastPage();
  102.  
  103. // ---------------------------------------------------------
  104.  
  105. //Close and output PDF document
  106. $pdf->Output('example_061.pdf', 'I');
  107.  
  108. ?>
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.
  #13 (permalink)  
Antiguo 14/03/2012, 21:37
 
Fecha de Ingreso: enero-2012
Ubicación: Lima
Mensajes: 19
Antigüedad: 12 años, 3 meses
Puntos: 1
Respuesta: Centrar tabla en XHTML

Te agradesco mucho que tomes tu tiempo para ayudar. Intente con lo que tu ponias pero no mostraba nada en el PDF.

Aqui esta el codigo que sale a medias, no centra en vertical si horizontal.
El codigo esta feo porque estuve probando con muchas cosas, disculpen el desorden.

Código PHP:
<?php
//============================================================+
// File name   : example_061.php
// Begin       : 2010-05-24
// Last Update : 2010-08-08
//
// Description : Example 061 for TCPDF class
//               XHTML + CSS
//
// Author: Nicola Asuni
//
// (c) Copyright:
//               Nicola Asuni
//               Tecnick.com LTD
//               Manor Coach House, Church Hill
//               Aldershot, Hants, GU12 4RQ
//               UK
//               www.tecnick.com
//               [email protected]
//============================================================+

/**
 * Creates an example PDF TEST document using TCPDF
 * @package com.tecnick.tcpdf
 * @abstract TCPDF - Example: XHTML + CSS
 * @author Nicola Asuni
 * @since 2010-05-25
 */

require_once('../config/lang/eng.php');
require_once(
'../tcpdf.php');

// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATIONPDF_UNITPDF_PAGE_FORMATtrue'UTF-8'false);

// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Nicola Asuni');
$pdf->SetTitle('TCPDF Example 061');
$pdf->SetSubject('TCPDF Tutorial');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');

// set default header data
//$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 061', PDF_HEADER_STRING);

// set header and footer fonts
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN''PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA''PDF_FONT_SIZE_DATA));

// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);

//set margins
$pdf->SetMargins(PDF_MARGIN_LEFTPDF_MARGIN_TOPPDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);

//set auto page breaks
$pdf->SetAutoPageBreak(TRUEPDF_MARGIN_BOTTOM);

//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);

//set some language-dependent strings
$pdf->setLanguageArray($l);

// ---------------------------------------------------------

// set font
$pdf->SetFont('helvetica'''10);

// add a page
$pdf->AddPage();

/* NOTE:
 * *********************************************************
 * You can load external XHTML using :
 *
 * $html = file_get_contents('/path/to/your/file.html');
 *
 * External CSS files will be automatically loaded.
 * Sometimes you need to fix the path of the external CSS.
 * *********************************************************
 */

// define some HTML content with style
$html = <<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">                
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>titulo</title> 
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <style type="text/css">
            html,body{
                height: 100%;
                width: auto;
            }
        </style>
    </head>
    <body>
        <table  align="right" cellpadding="0" cellspacing="0" border="0" style="text-align:left; width:640px;">
            <tr>
                <td width="40">
                </td>
                <td>
                    <table border="1" cellspacing="0" bordercolor="#000000">
                        <tr>
                            <td align="center"  style="padding:0px;" width="115">
                                <div style="text-align: center; line-height: 0px;">&nbsp;                            
                                    <img border="0" align="center"  width="113"  height="151" src="../images/hola.JPG" />            
                                </div>                
                            </td>
                            <td align="center" valign="center" style="padding:4px;" width="485">
                                <table id="tabla" cellpadding="3.11"padding="3" cellspacing="0" border="0" style="text-align:left; width:500px;">
                                    <tr>
                                        <td style="padding:4px;" width="135">Apellidos y nombres </td>
                                        <td style="padding:4px;" width="342"><strong>afsadfsadf</strong></td>
                                    </tr>
                                    <tr>
                                        <td  style="padding:4px;" width="135">43fff</td>
                                        <td style="padding:4px;" width="342"><strong>34443434</strong></td>
                                    </tr>
                                    <tr>
                                        <td  style="padding:4px;" width="135">Fecha de nacimiento </td>
                                        <td style="padding:4px;" width="342"><strong>14/141</strong></td>
                                    </tr>
                                    <tr>
                                        <td  style="padding:4px;" width="135">Estado civil </td>
                                        <td style="padding:4px;" width="342"><strong>dfsadfasdf</strong></td>
                                    </tr>
                                    <tr>
                                        <td style="padding:4px;" width="135">Sexo</td>
                                        <td   style="padding:4px;" width="342"><strong>asdfsadfsdaf</strong></td>
                                    </tr>
                                    <tr>
                                        <td  style="padding:4px;" width="135">Tel&eacute;fonos</td>
                                        <td style="padding:4px;" width="342"><strong>43443434443</strong></td>
                                    </tr>
                                    <tr>
                                        <td  style="padding:4px;" width="135">Correos electr&oacute;nicos </td>
                                        <td   style="padding:4px;" width="342"><strong>asdfsadfasdf</strong></td>
                                    </tr>
                                </table>
                            </td>
                        </tr>    
                      </table>
                </td>            
            </tr>
        </table>
    </body>
</html>
EOF;

// output the HTML content
$pdf->writeHTML($htmltruefalsetruefalse'');

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

// *******************************************************************
// HTML TIPS & TRICKS
// *******************************************************************

// REMOVE CELL PADDING
//
// $pdf->SetCellPadding(0);
// 
// This is used to remove any additional vertical space inside a 
// single cell of text.

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

// REMOVE TAG TOP AND BOTTOM MARGINS
//
// $tagvs = array('p' => array(0 => array('h' => 0, 'n' => 0), 1 => array('h' => 0, 'n' => 0)));
// $pdf->setHtmlVSpace($tagvs);
// 
// Since the CSS margin command is not yet implemented on TCPDF, you
// need to set the spacing of block tags using the following method.

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

// SET LINE HEIGHT
//
// $pdf->setCellHeightRatio(1.25);
// 
// You can use the following method to fine tune the line height
// (the number is a percentage relative to font height).

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

// CHANGE THE PIXEL CONVERSION RATIO
//
// $pdf->setImageScale(0.47);
// 
// This is used to adjust the conversion ratio between pixels and 
// document units. Increase the value to get smaller objects.
// Since you are using pixel unit, this method is important to set the
// right zoom factor.
// 
// Suppose that you want to print a web page larger 1024 pixels to 
// fill all the available page width.
// An A4 page is larger 210mm equivalent to 8.268 inches, if you 
// subtract 13mm (0.512") of margins for each side, the remaining 
// space is 184mm (7.244 inches).
// The default resolution for a PDF document is 300 DPI (dots per 
// inch), so you have 7.244 * 300 = 2173.2 dots (this is the maximum 
// number of points you can print at 300 DPI for the given width).
// The conversion ratio is approximatively 1024 / 2173.2 = 0.47 px/dots
// If the web page is larger 1280 pixels, on the same A4 page the 
// conversion ratio to use is 1280 / 2173.2 = 0.59 pixels/dots

// *******************************************************************

// reset pointer to the last page
$pdf->lastPage();

// ---------------------------------------------------------

//Close and output PDF document
$pdf->Output('example_061.pdf''I');

//============================================================+
// END OF FILE                                                
//============================================================+

Etiquetas: tablas, tcpdf, xhtml
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 03:16.