【发布时间】:2016-03-02 13:45:28
【问题描述】:
如果有人知道这一点,请帮助我。如何为 pdf 命名。 我使用 mpdf codeigniter 生成了 pdf。单击按钮即可查看pdf。但是如何为该pdf命名?它在 pdf 的顶部显示 1。我如何为该 pdf 命名? 我的控制器
public function viewpdf($key,$option) {
if($option=='1')
{
$searchdata['fetchproduct']=$this->b2bproduct_model->fetch_productdata1($key);
}
if($option=='2')
{
$searchdata['fetchproduct']=$this->b2bproduct_model->fetch_productdata2($key);
}
if($option=='3')
{
$searchdata['fetchproduct']=$this->b2bproduct_model->fetch_productdata3($key);
}
$html=$this->load->view('moderator/pdf_data', $searchdata,true);
//this the the PDF filename that user will get to download
$pdfFilePath = "shany.pdf";
//load mPDF library
$this->load->library('m_pdf');
//generate the PDF from the given html
$this->m_pdf->pdf->WriteHTML($html);
//download it.
$this->m_pdf->pdf->Output($pdfFilePath, "I");
}
【问题讨论】:
-
请显示一些(真实的)代码。
-
@phaberest 我把代码放在这里
标签: codeigniter codeigniter-2 mpdf codeigniter-3