Ver Mensaje Individual
  #1 (permalink)  
Antiguo 08/02/2014, 19:45
tattojk
 
Fecha de Ingreso: febrero-2005
Mensajes: 673
Antigüedad: 19 años, 2 meses
Puntos: 2
Pregunta No me toma el salto de pagina con dompf

Cordial saludo

Estoy trabajando con php 5 y mysql 5 y realizo unas consultas y voy armando el html en una variable; por supuesto los resultados de las consultas las mostrare en una tabla, no tengo problemas para crear el pdf; solo para realizar un salto de pagina por medio de
Código PHP:
<br style "page-break-before:always;"
El pdf me lo crea bien pero en la segunda hoja me muestra la tabla con los resultados y no los muestra todos. Tengo una condicion que si es el registro 4 haga un salto de pagina pero no lo hace. Este es mi código

Código PHP:
<?php
    session_start
();
    include(
"Operaciones.php");
    
$sedConsecutivo 1;    
    
$acConsecutivo 2;
    
$jorConsecutivo 4;
    
$FechInic '2014-01-01';
    
$FechFina '2014-02-07';
    
$conConsecutivo 8;
$html '
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Listado Carn&eacute;</title>
<link rel="stylesheet" type="text/css" href="../../../Css/Estilos.css" media="all" />
<style>
@page {
            margin-top: 2.2em;
            margin-left: 2.1em;
            margin-right: 0.8em;
        }
</style>
</head>

<body>
<table width="85%" border="0" align="center" cellpadding="0" cellspacing="0" class="TextoNormal">
  <tr>
    <td colspan="2"><div align="center"><img src="../../../Imagenes/Logo.jpg"/></div></td>
  </tr>
  <tr>
    <td colspan="2">&nbsp;</td>
  </tr>'
;
    
$DatoAreaCapa BusqAreaCapa($acConsecutivo$jorConsecutivo$conConsecutivo$sedConsecutivo'A'$FechInic$FechFina);
    
$ContAreaCapa count($DatoAreaCapa);
    for(
$i 0$i $ContAreaCapa$i++)
        {
            
$ContRegi 1;
$html $html.'
  <tr>
    <td width="57%"><strong>&Aacute;REA DE CAPACITACI&Oacute;N:&nbsp;</strong>'
.$DatoAreaCapa[$i]['acNombre'].'</strong></td>
    <td width="43%"><strong>JORNADA:&nbsp;</strong>'
.$DatoAreaCapa[$i]['jorNombre'].'</td>
  </tr>
  <tr>
    <td colspan="2"><table width="100%" border="1" align="center" cellpadding="8" cellspacing="0" class="TextoNormal" style=\'page-break-after:always;\'>'
;
            
$DatoEstu BusqEstu($DatoAreaCapa[$i]['acConsecutivo'], $DatoAreaCapa[$i]['jorConsecutivo'], $conConsecutivo$sedConsecutivo'A'$FechInic$FechFina);
            
$ContEstu count($DatoEstu);
            for(
$j 0$j $ContEstu$j++)
                {
$html $html.'
      <tr>
        <td width="21%" rowspan="5">&nbsp;</td>
        <td width="19%"><strong>NOMBRES</strong></td>
        <td width="60%">'
.$DatoEstu[$j]['estPrimNomb']." ".$DatoEstu[$j]['estSeguNomb'].'</td>
      </tr>
      <tr>
        <td><strong>APELLIDOS</strong></td>
        <td>'
.$DatoEstu[$j]['estPrimApel']." ".$DatoEstu[$j]['estSeguApel'].'</td>
      </tr>
      <tr>
        <td><strong>TIPO DOCUMENTO</strong></td>
        <td>'
.$DatoEstu[$j]['tdCodigo'].'</td>
      </tr>
      <tr>
        <td><strong>N&Uacute;MERO DOCUMENTO</strong></td>
        <td>'
.number_format($DatoEstu[$j]['estNumeIden'], 0'''.').'</td>
      </tr>
      <tr>
        <td><strong>RH</strong></td>
        <td>'
.$DatoEstu[$j]['gsNombre'].'</td>
      </tr>'
;
                    if(
$ContRegi == 4){
                        
$ContRegi 1;
                        
$html $html.'<br style = \'page-break-before:always;\'>';
                    }
                    
$ContRegi++;
                }
$html $html.'
    </table></td>
  </tr>
  <tr>
    <td colspan="2">&nbsp;</td>
  </tr>'
;
/*              echo "<table width="100%" border="1" align="center" cellpadding="8" cellspacing="0" class="TextoNormal" rules="all" style=\'page-break-after:always;\'></table>";*/
        
}
$html $html.'
</table>
</body>
</html>'
;
    require_once(
"../../../dompdf/dompdf_config.inc.php");
    
spl_autoload_register('DOMPDF_autoload'); 
    
$dompdf = new DOMPDF();
    
$dompdf->load_html($html);
    
$dompdf->set_paper("letter""portrait");
    
$dompdf->render();
    
$dompdf->stream("ListaCarne.pdf", array("Attachment" => false));
?>
Agradezco de antemano la ayuda y sugerencias que me puedan brindar.