4

I need to print a large table content on multiple pages by using mpdf.

action code

<?php
.....
 $pdfFile = Yii::$app->security->generateRandomString(40) . ".pdf";
            $pdf = new Pdf([
                'mode' => Pdf::MODE_UTF8,
                'format' => Pdf::FORMAT_A4,
                'orientation' => Pdf::ORIENT_PORTRAIT,
                'destination' => Pdf::DEST_FILE,
                'content' => $content,
                'filename' => Helper::UPLOAD_FOLDER . "/" . Helper::REPORT_FOLDER . "/" . $pdfFile,
                'options' => ['title' => $pageTitle],
                'methods' => [
                    'SetHTMLFooter' => [$footerText],
                ]
                ,
            ]);

            $pdf->render();
...
?>
enter code here

And this is the view code which is loaded in the pdf

<div style="page-break-inside:auto">
<table style="page-break-inside: auto;">
    <tr>
        <td>

       The large content here 

        </td>
    </tr>


</table>

</div>

The table content is fit to one page but I need to be on multiple pages. problem

I tested the solution which is mentioned in the link but it dosn't work .

https://mpdf.github.io/tables/tables.html

Ahmad Samilo
  • 914
  • 16
  • 30

0 Answers0