0

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

上記のコードは機能しますが、テーブルはすべて縦向きで表示されます。$html3 のテーブルを横向きで表示する必要があります。これを行う方法はありますか?私が推測する mpdF プロパティか何か。また、同じPDFの次のページの先頭$html3に分離して配置する方法はありますか?

4

1 に答える 1

1

横向きで AddPage を試してください:

$mPDF1->WriteHTML($html2,2);
//$html2 is a widget/table with a portrait orientation

$mPDF1->AddPage('L');
$mPDF1->WriteHTML(&html3,2);
于 2013-09-27T06:38:16.277 に答える