yii2 mpdf - 表格填充剩余空间直到页脚

问题描述

页眉、页脚和内容是动态的。如何将内容拉伸到页脚。 标题在每一页上重复。页脚只出现在最后一页。 问题是我希望表格的最后一行到达页脚,因此空间被填满。

enter image description here

代码

控制器.PHP

$pdf = Yii::$app->pdf;
        $mpdf = $pdf->api;
        $mpdf->defaultheaderline = 0;
        $mpdf->defaultfooterline = 0; // fetches mpdf api
        $mpdf->SetMargins(0,0); // will set it to 0 for all pages.
        // $stylesheet = file_get_contents('/pdf/pdf.css');

        $mpdf->WriteHTML(Yii::$app->controller->renderPartial('/pdf/pdf-css.css'),\Mpdf\HTMLParserMode::HEADER_CSS);
        $mpdf->setAutoBottomMargin = true;
        $mpdf->setAutoTopMargin = true;
        $mpdf->SetHeader(Yii::$app->controller->renderPartial('/pdf/client-invoice-header',[
            'model' => $model,'modelItems' => $modelItems,'JobCardFiles' => $JobCardFiles,'amountArray' => $amountArray,'amountInWords' => $amountInWords

        ])); // call methods or set any properties
        $mpdf->WriteHTML(Yii::$app->controller->renderPartial('/pdf/pdf-view-client-invoice','amountInWords' => $amountInWords

        ]));
        // $mpdf->WriteHtml($content); // call mpdf write html
        $mpdf->SetFooter(Yii::$app->controller->renderPartial('/pdf/client-invoice-footer','amountInWords' => $amountInWords

        ])); // call methods or set any properties

        echo $mpdf->Output($model->invoice_no . '.pdf','I'); // call the mpdf api output as needed


解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)