dompdf排除菜单和页脚



Hy,我使用dompdf并且当生成pdf时;母亲;页面。我不知道在哪里编辑代码以排除菜单和页脚。

代码控制器:

function export_invoice($param1 = 'export' ) {
$page_data['action']   = $param1;
$page_data['page_name'] = 'export_invoice';
$page_data['page_title'] = get_phrase('export_invoice');
$this->load->view('frontend/'.get_frontend_settings('theme').'/index', $page_data);
$html1 =$this->load->view('frontend/'.get_frontend_settings('theme').'/index',$page_data, true);
$html = mb_convert_encoding($html1, 'HTML-ENTITIES', 'UTF-8');
$this->pdf->loadHtml($html);
$this->pdf->set_paper("a5", "portrait" ); //landscape
$this->pdf->render();
// FILE DOWNLOADING CODES
$url = current_url();
$str = substr(strrchr($url, '/'), 1);
$str1=$str;
$fileName = 'Invoice-'.$str.'.pdf';
$this->pdf->stream($fileName, array("Attachment" => 0)); //initial era 1 pentru descarcare si 0 pentru preview in broswer
}

和视图:

<html>
<head>
<meta charset="utf-8">
<title>PDF Output</title>
<style>
/* your style here */
</style>
</head>
<body>
{contents}
</body>
</html>

pdf 中的图像

我使用css,它与一起工作

.menu-area{display: none;}

相关内容

  • 没有找到相关文章

最新更新