发送邮件时将html转换为pdf



发送邮件时如何在CODEIGNITER中将HTML文件转换为PDF?

$this->load->library('html2pdf');
$this->html2pdf->folder('./assets/pdfs/');
$this->html2pdf->filename('email_test.pdf');
$this->html2pdf->paper('a4', 'portrait');
$data = array(
'title' => 'PDF Created',
'message' => 'Hello World!'
);
//Load html view
$this->html2pdf->html($this->load->view('pdf', $data, true));
//Check that the PDF was created before we send it
$path = $this->html2pdf->create('save');

我使用此代码进行转换。

也许你可以试试TCPDF,它一直对我有效:(TCPDF集成CI

相关内容

  • 没有找到相关文章

最新更新