Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php MPDF景观不起作用_Php - Fatal编程技术网

Php MPDF景观不起作用

Php MPDF景观不起作用,php,Php,我在codeigniter中使用MPDF,但它始终是纵向的 为什么总是肖像画 public function downloadstatisticsWeek1() { $data = []; $html = $this->load->view('pdf/weeklyKeyIndicatorReportWeek1', $data, true); $pdfFilePath = "Pcdom Statistics As of ". da

我在codeigniter中使用MPDF,但它始终是纵向的

为什么总是肖像画

public function downloadstatisticsWeek1()
    {
        $data = [];
        $html = $this->load->view('pdf/weeklyKeyIndicatorReportWeek1', $data, true);
        $pdfFilePath = "Pcdom Statistics As of ". date('F d Y')." .pdf";
        $this->load->library('pcdom_pdf_converter');

        $

        $param = '"en-GB-x","Letter-L","","",10,10,10,10,6,3';

        $pdfer = new mPDF($param);
        $pdfer->WriteHTML($html);
        $pdfer->output($pdfFilePath, "D");
    }

是否我的$para不正确?

尝试删除$param,请参见以下内容:

//$param = '"en-GB-x","Letter-L","","",10,10,10,10,6,3';

$pdfer = new mPDF("en-GB-x","Letter-L","","",10,10,10,10,6,3);
您的代码问题:您正在将一个字符串传递到mPDF,该字符串无效

如果您想重新使用param,您可以尝试以下版本,但我没有测试,ps:它适用于mPDF版本7,详细信息请参考此

最后,你也可以考虑这个函数。

$param = array(
    'mode' => 'en-GB-x',
    'format' => 'Letter-L',
    'margin_left' => 10,
    'margin_right' => 10,
    'margin_top' => 10,
    'margin_bottom' => 10,
    'margin_header' => 6,
    'margin_footer' => 3
);