使用mpdf lib在多个页面上打印大表内容

时间:2018-02-05 06:14:29

标签: php yii2 mpf

我需要使用mpdf在多个页面上打印一个大表内容。

动作代码

<?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

这是加载在pdf中的视图代码

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

       The large content here 

        </td>
    </tr>


</table>

</div>

表格内容适合一个页面,但我需要在多个页面上。 problem

我测试了链接中提到的解决方案,但它没有工作。

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

0 个答案:

没有答案
相关问题