【发布时间】:2016-10-27 13:13:25
【问题描述】:
我在尝试 snappy 库的示例时遇到了一些麻烦。当我尝试使用 getOutput 函数显示时,浏览器返回 ERR_INVALID_RESPONSE。我尝试了发布here 的解决方案,但它对我不起作用。
这是我的函数代码:
// Display the resulting pdf in the browser
// by setting the Content-type header to pdf
$snappy = new Pdf('/usr/local/bin/wkhtmltopdf');
header('Content-Type: application/pdf',true,200);
header('Content-Disposition: attachment; filename="file.pdf"');
echo $snappy->getOutput('http://www.github.com');
我们将非常感谢您的帮助/建议/建议。提前谢谢!
【问题讨论】:
标签: php laravel pdf laravel-snappy