我使用cakepdf使用wkhtmltopdf生成pdf文件并且它有效,问题是当我想在文件夹中创建pdf文件时它会向我显示此例外:
System error <pre>Exit with code 1 due to network error: ContentNotFoundError </pre>
这是我用于生成pdf文件的代码:
$CakePdf = new CakePdf();
$CakePdf->template('mynote','default');
//get the pdf string returned
$pdf = $CakePdf->output();
//or write it to file directly
$pdf = $CakePdf->write(APP . 'webroot'. DS .'files' . DS . 'mynote.pdf');
对于pdf模板,我使用了仅在pdf文件夹中包含此代码的mynote.ctp
<div>Hello</div>
经过一番喧嚣后,我通过在输出函数中注释代码来消除这个错误,但我仍然无法获得样式和图像,就像我习惯的那样。 提前谢谢。