Foros del Web » Programando para Internet » PHP »

[SOLUCIONADO] Problema con Html2PDF

Estas en el tema de Problema con Html2PDF en el foro de PHP en Foros del Web. HOLA, tengo un problema con la librería que creo que tal vez excede el tiempo de respuesta, aquí genero un reporte dinámico, y cada tulpla ...
  #1 (permalink)  
Antiguo 25/05/2015, 19:12
 
Fecha de Ingreso: mayo-2015
Mensajes: 5
Antigüedad: 8 años, 11 meses
Puntos: 0
Problema con Html2PDF

HOLA, tengo un problema con la librería que creo que tal vez excede el tiempo de respuesta, aquí genero un reporte dinámico, y cada tulpla va a ir en una hoja, y solo me lanza 8 hojas ya de ahi se cuelga y no me saca nada( después de 9 hojas) este es mi código:
<? ob_start(); ?>
<page>
<!--************************************************** ************************************************** *************************************-->
<!-- FOOTER -->
<!--************************************************** ************************************************** *************************************-->
<page_footer>
<table class="piePagina">
<tr>
<td style="width: 100%; text-align: center">
SECOLIM
</td>
</tr>
</table>
</page_footer>
<!--************************************************** ************************************************** *************************************-->
<!-- CONTENT -->
<!--************************************************** ************************************************** *************************************-->
<?php
include_once( '../config/ClsConexion.php' );

include_once( '../controller/ClsEmpleadoCapacitacion.php' );
$clsEmpleadoCapacitacion = new ClsEmpleadoCapacitacion();
$arrEmpleadoCapacitacion = $clsEmpleadoCapacitacion->EmpleadoCapacitacionListaDiplomaPDF();

foreach ($arrEmpleadoCapacitacion as $rowEmpleadoCapacitacion) {
$idEmpleadoCapacitacion = $rowEmpleadoCapacitacion['idEmpleadoCapacitacion'];
$idEmpleadoEmpresa = $rowEmpleadoCapacitacion['idEmpleadoEmpresa'];
$idEmpleadoCentroTrabajo = $rowEmpleadoCapacitacion['idEmpleadoCentroTrabajo'];
$idEmpleado = $rowEmpleadoCapacitacion['idEmpleado'];
$idEmpleadoCurso = $rowEmpleadoCapacitacion['idEmpleadoCurso'];
$id = $rowEmpleadoCapacitacion['id'];
}
?>
<table width="auto" align="center">
<?php foreach ($arrEmpleadoCapacitacion as $rowEmpleadoCapacitacion) { ?>
<tr>
<td align="center" style="font-size: 20px;"> <br> </td>
</tr>
<tr>
<td>
<table class="encabezado">
<tr>
<td style="width: 20%; text-align: left">
<img align="left" class="img-rounded" src="../img/loby.png" width="130" height="110" />
</td>
<td style="width: 60%; font-family: Helvetica; font-size: 22px; text-align: center">
CONSTANCIA DE COMPETENCIAS O DE HABILIDADES LABORALES
</td>
<td id="1" style="width: 20%; font-size: 14px; text-align: right">
<br><br><br><br>
<?php
// Establecer la zona horaria predeterminada a usar
date_default_timezone_set('UTC');
setlocale(LC_ALL, "es_ES");
?>
<?php
//fecha en que se emitió el reporte
echo utf8_encode(strftime("%A, %d de %B del %Y"));
?><br />
</td>
</tr>
</table>
</td>
</tr>
<tr >
<td align="center" style="font-size: 20px;"><? echo utf8_encode($rowEmpleadoCapacitacion['empresa']);?></td>
</tr>
<tr >
<td align="center" style="font-size: 20px;"><? echo utf8_encode($rowEmpleadoCapacitacion['centroTrabajo']);?></td>
</tr>
<tr >
<td align="center" style="font-size: 14px;">RFC: <? echo utf8_encode($rowEmpleadoCapacitacion['rfc']);?></td>
</tr>
<tr>
<td align="center" style="font-size: 20px;"> <br> </td>
</tr>
<tr >
<td align="center" style="font-size: 16px;">Se Otorga La Presente Para:</td>
</tr>
<tr>
<td align="center" style="font-size: 20px;">
<? echo utf8_encode($rowEmpleadoCapacitacion['nombre']);?> <? echo utf8_encode($rowEmpleadoCapacitacion['paterno']);?> <? echo utf8_encode($rowEmpleadoCapacitacion['materno']);?> </td>
</tr>
<tr>
<td align="center" style="font-size: 20px;"> <br> </td>
</tr>
<tr>
<td align="center" style="font-size: 14px;">CURP: <? echo utf8_encode($rowEmpleadoCapacitacion['curp']);?></td>
</tr>
<tr>
<td align="center" style="font-size: 14px;">OCUPACIÓN:<? echo utf8_encode($rowEmpleadoCapacitacion['puesto']);?></td>
</tr>
<tr>
<td align="center" style="font-size: 20px;"> <br> </td>
</tr>
<tr >
<td align="center" style="font-size: 16px;">Por Haber Aprobado El Curso:</td>
</tr>
<tr>
<td align="center" style="font-size: 20px;"><? echo utf8_encode($rowEmpleadoCapacitacion['curso']);?></td>
</tr>
<tr>
<td align="center" style="font-size: 20px;"> <br> </td>
</tr>
<tr >
<td align="center" style="font-size: 16px;">Impartido del <? echo utf8_encode($rowEmpleadoCapacitacion['fechaHora']);?> en <? echo utf8_encode($rowEmpleadoCapacitacion['lugar']);?></td>
</tr>
<tr >
<td align="center" style="font-size: 16px;"> <? echo utf8_encode($rowEmpleadoCapacitacion['notas']);?> </td>
</tr>
<tr>
<td align="center" style="font-size: 20px;"> <br> </td>
</tr>
<tr >
<td align="center" style="font-size: 12px;">
Los datos se asientan en esta constancia bajo protesta de decir verdad, apercibidos de la responsabilidad en que incurre todo aquel que no se conduce con verdad.</td>
</tr>
<tr >
<td align="center" style="font-size: 14px;">
Agente Capacitador: <? echo utf8_encode($rowEmpleadoCapacitacion['imparte']);?>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Por la Comisión Mixta de Capacitación, Adiestramiento y Productividad.</td>
</tr>
<tr>
<td align="center" style="font-size: 20px;"> <br> </td>
</tr>
<tr>
<td align="center" style="font-size: 20px;"> <br> </td>
</tr>
<tr>
<td>
<table width="auto" style="background:#cccccc; font-size: 14px; border-collapse:collapse; ">
<tr>
<td style="width: 30%;font-size: 12px; text-align: center">
<? echo utf8_encode($rowEmpleadoCapacitacion['imparte']);?>
</td>
<td style="width: 40%; font-family: Helvetica; font-size: 12px;text-align: center">
<? echo utf8_encode($rowEmpleadoCapacitacion['repreLegal']);?>
</td>
<td id="1" style="width: 30%; font-size: 12px; text-align: center">
<? echo utf8_encode($rowEmpleadoCapacitacion['imparte']);?>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="auto" style="background:#cccccc; font-size: 14px; border-collapse:collapse; ">
<tr>
<td style="width: 30%;font-size: 12px; text-align: center">
CAPACITADOR
</td>
<td style="width: 40%; font-family: Helvetica; font-size: 12px;text-align: center">
POR EMPRESA O PATRON O REPRESENTANTE LEGAL
</td>
<td id="1" style="width: 30%; font-size: 12px; text-align: center">
POR TRABAJADORES
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" style="font-size: 20px;"> <br> </td>
</tr>
<tr>
<td align="center" style="font-size: 20px;"> <br> </td>
</tr>
<?php }; ?>
</table>
</page>

<!--************************************************** ************************************************** *************************************-->
<!-- FUNCTION -->
<!--************************************************** ************************************************** *************************************-->
<?php
$content = ob_get_clean();
require_once('../model/html2pdf/html2pdf.class.php');
try {
$pdf = new HTML2PDF('L', 'A4', 'es', 'UTF-8');
$pdf->writeHTML($content);
$pdf->pdf->IncludeJS('print(TRUE)');
$pdf->output('Constancias.pdf');
} catch (HTML2PDF_exception $e) {
echo $e;
}
?>

Espero me puedas ayudar

Etiquetas: fecha, html, html2pdf
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 01:59.