mpdf error There was an error loading the PDF document

0

I'm using mpdf and I have the following problem, using this test code works perfectly for me

    <?php
    include_once("mpdf/mpdf.php");
    $mpdf = new mPDF('R','A4', 11,'Arial');
    $mpdf -> SetTitle('Ejemplo de generación de PDF');
    $mpdf -> WriteHTML('<body>');
    $mpdf -> WriteHTML('Aquí puedes poner todas las etiquetas HTML que mpdf te permite utilizar.');
    $mpdf -> WriteHTML('</body>');
    $mpdf -> Output('NombreDeTuArchivo.pdf', 'I');
    exit;
    ?>

pero cuando le agrego a la funcion WriteHTML(); un codigo html me sale el error "Se ha producido un error al cargar el documento PDF." como en el codigo 

<?php
include_once("mpdf/mpdf.php");
$cabecera = '<table width="100%" border="1" align="center">

                                    <tr>
                                        <th align="center"></th>
                                        <th align="center">ACTA DE REUNI&Oacute;N</th>
                                        <th align="center">VERSI&Oacute;N 1</th>
                                    </tr>

                        </table>';
$mpdf = new mPDF('R','A4', 11,'Arial');
$mpdf -> SetTitle('Ejemplo de generación de PDF');
$mpdf -> WriteHTML('<body>');
$mpdf -> WriteHTML($cabecera);<--------
$mpdf -> WriteHTML('</body>');
$mpdf -> Output('NombreDeTuArchivo.pdf', 'I');
exit;
?>
    
asked by Billy Nieto 06.10.2018 в 01:05
source

0 answers