html - 使用 mpdf 6.1 加载 PDF 文档失败
问题描述
我在我的系统和 mpdf 6.1 中使用 codeigniter 来生成 pdf。每次打开新标签页进行预览时,我都会在 chrome 中收到错误“无法加载 PDF 文档”。那有什么问题?我要打印的 html 代码:
include_once APPPATH . 'third_party/mPDF/mpdf.php';
$title= 'customer';
$html .= '<html>';
$html .= '<body>';
$html .= '<table>';
$html .= '</table>';
$html .= '</body>';
$html .= '</html>';
$mpdf = new mPDF('c', 'A4', '', '', 10, 10, 55, 20, 10, 10);
$mpdf->SetProtection(array('print'));
$mpdf->SetDisplayMode('fullpage');
$mpdf->WriteHTML($html);
$mpdf->setTitle($title);
$mpdf->Output(url_title($title.'.pdf'), 'i');
谢谢 :)
解决方案
推荐阅读
- excel - VBA重复搜索分隔列并将值打印到新行
- laravel - Laravel Chart: xAxes doesn't start from zero
- javascript - Javascript and Mysql save api data
- c++ - clang-tidy ignoring preprocessor directives
- bash - problems with bash script array aways giving same error
- python - How to convert 4D image array to 3D image array
- python - How to open file in another folder in Python?
- python - code to figure out lowercase vowels, python question
- python - Tensorflow 序列扩展的动态 __len__?
- c# - 如何禁用数据网格中组列描述字段的排序?