Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.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
mPDF使用CODEIGNITER在第一页创建了比其他页面更多的页边距顶部_Codeigniter_Mpdf - Fatal编程技术网

mPDF使用CODEIGNITER在第一页创建了比其他页面更多的页边距顶部

mPDF使用CODEIGNITER在第一页创建了比其他页面更多的页边距顶部,codeigniter,mpdf,Codeigniter,Mpdf,在这里,我将提供我的代码来创建一个发票,所有的事情都进展顺利,除了PDF在第一页比其他页面占用更多的空白 function createInvoice($invoiceId) { ini_set('memory_limit', '256M'); // load library $this->load->library('pdf'); $pdf = $this->pdf->load(); //

在这里,我将提供我的代码来创建一个发票,所有的事情都进展顺利,除了PDF在第一页比其他页面占用更多的空白

function createInvoice($invoiceId) {
        ini_set('memory_limit', '256M');
        // load library
        $this->load->library('pdf');
        $pdf = $this->pdf->load();
        // $pdf->useAdobeCJK = true;   
        // $pdf->SetAutoFont(AUTOFONT_ALL);
        // retrieve data from model
        $data['invoice'] = $this->reports_model->retInvoice($invoiceId);
        $data['items'] = $this->reports_model->retItems($invoiceId);
        $data['title'] = 'بل';

        $pdf->SetHTMLHeader('<div style="text-align: right; font-weight: bold; "></div>','O');

        $pdf->SetHTMLHeader('<div style="border-bottom: 1px solid #000000;"></div>','E');

        $pdf->SetHTMLFooter('<table style="vertical-align: bottom; font-family: serif; font-size: 8pt; color: #000000; font-weight: bold; font-style: italic;"><tr>
                             <td style="font-weight: bold; font-style: italic; border: none;">{PAGENO}/{nbpg}</td>
                             </tr></table>');
        $pdf->SetHTMLFooter('<table style="vertical-align: bottom; font-family: serif; font-size: 8pt; color: #000000; font-weight: bold; font-style: italic;"><tr>
                             <td align="left" style="font-weight: bold; border: none; font-style: italic;">{PAGENO}/{nbpg}</td>
                             </tr></table>', 'E');

        $pdf->AddPage('', // L - landscape, P - portrait 
            '', '', '', '',
            12, // margin_left
            12, // margin right
            30, // margin top
            30, // margin bottom
            0, // margin header
            0); // margin footer
        // boost the memory limit if it's low ;)
        $html = $this->load->view('reports/invoice', $data, true);


        // render the view into HTML
        $pdf->WriteHTML($html);
        // write the HTML into the PDF
        $output = $invoiceId . '--' . date('Y_m_d_H_i_s') . '_.pdf';
        $pdf->Output("$output", 'I');   
    }
函数createInvoice($invoiceId){
ini设置(“内存限制”、“256M”);
//加载库
$this->load->library('pdf');
$pdf=$this->pdf->load();
//$pdf->useAdobeCJK=true;
//$pdf->SetAutoFont(全部自动字体);
//从模型中检索数据
$data['invoice']=$this->reports\u model->retInvoice($invoiceId);
$data['items']=$this->reports\u model->retItems($invoiceId);
$data['title']=“بل”;
$pdf->SetHTMLHeader(“”,'O');
$pdf->SetHTMLHeader(“”,'E');
$pdf->SetHTMLFooter($pdf)
{PAGENO}/{nbpg}
');
$pdf->SetHTMLFooter($pdf)
{PAGENO}/{nbpg}
","E",;
$pdf->AddPage(“”,//L-横向,P-纵向
'', '', '', '',
12,//左边空白处
12、//右边距
30,//页边距顶部
30,//页边距底部
0,//页边距页眉
0);//页边距页脚
//如果内存不足,请提高内存限制;)
$html=$this->load->view('reports/invoice',$data,true);
//将视图呈现为HTML
$pdf->WriteHTML($html);
//将HTML写入PDF
$output=$invoiceId.'-'.date('Y_m_d_H_i_s')。'uu.pdf';
$pdf->Output(“$Output”,'I');
}
有什么帮助吗 一切帮助都将不胜感激。
谢谢。

这是我的错,在我的视图CSS中,我的主分区的页边距顶部为100像素。这是我的错,我的视图CSS中,我的主分区的页边距顶部为100像素。