Yii,Php,mPDF,生成带有不同方向的小部件的pdf


Yii, Php, mPDF, generating a pdf with widgets of different orientations

我正在用Yii php实现一个应用程序,我正在尝试使用mPDF扩展制作PDF

正在生成一种摘要报告,我在其中为其制作pdf。生成的pdf内部是3个小部件,基本上是用于创建该报告的表格。

下面是它的外观:

$mPDF1 = Yii::app()->ePdf->mpdf();
$mPDF1 = Yii::app()->ePdf->mpdf('', 'A5');
..
..//set mpdf properties etc..
$mPDF1->WriteHTML($stylesheet, 1);
$mPDF1->WriteHTML($html1,2);
//say $html1 is a widget/table  with a portrait orientation
$mPDF1->WriteHTML($html2,2);
//$html2 is a widget/table with a portrait orientation
$mPDF1->WriteHTML(&html3,2);
//$html3 is a widget/table that needs to have a landscape orientation because it's too long.
//and then output the pdf and so on..

上面的代码有效,但以纵向显示所有表格,我需要以横向显示 $html 3 表格。有没有办法做到这一点?我猜mpdF属性或其他什么。而且,有没有办法将$html3分开并将其放在同一 PDF 的下一页的开头

尝试添加横向页面:

$mPDF1->WriteHTML($html2,2);
//$html2 is a widget/table with a portrait orientation
$mPDF1->AddPage('L');
$mPDF1->WriteHTML(&html3,2);