(‘Content-Disposition: inline; filename=”‘.filename.'”‘); header(‘Content-Transfer-Encoding: binary’)...搜索‘thinkphp5加载tcpdf生成pdf’得到启示
结尾加上exit() 语句,就能解决
在使用php开发一些项目时, 经常会用到php直接生成pdf文件, 开源类 tcpdf是一个很不错的选择...打开tcpdf.php文件, 第7643行, 增加 die() 或者 exit() 语句
即 function Output函数中当第二个参数是I时, 为直接输出到浏览器, 这里已经不需要返回什么信息...SetAutoPageBreak(TRUE, '15');
// 设置图像比例因子
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
if (@file_exists...;
$pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
$pdf->Output(config("filepath